VRFS-3007 : Test for presence of online presence and performance samples for musician profile feature. Also, add classes to ease identification of dynamically added elements. Fix a few style issues.

This commit is contained in:
Steven Miers 2015-05-11 17:25:57 -05:00
parent 294c01d44a
commit b0fd3fd4c8
4 changed files with 41 additions and 15 deletions

View File

@ -567,7 +567,7 @@
}
$.each(jamkazamSamples, function(index, sample) {
$jamkazamSamples.append("<a href='/recordings/" + sample.claimed_recording.id + "' rel='external'>" + formatTitle(sample.claimed_recording.name) + "</a><br/>");
$jamkazamSamples.append("<a class='jamkazam-playable' href='/recordings/" + sample.claimed_recording.id + "' rel='external'>" + formatTitle(sample.claimed_recording.name) + "</a><br/>");
});
$.each(soundCloudSamples, function(index, sample) {
@ -575,7 +575,7 @@
});
$.each(youTubeSamples, function(index, sample) {
$youTubeSamples.append("<a href='" + sample.url + "' rel='external'>" + formatTitle(sample.description) + "</a><br/>");
$youTubeSamples.append("<a class='youtube-playable' href='" + sample.url + "' rel='external'>" + formatTitle(sample.description) + "</a><br/>");
});
}
}

View File

@ -1,6 +1,6 @@
@import "client/common.css.scss";
#user-profile {
#user-profile, #band-profile {
.profile-about-right {
textarea {
@ -10,8 +10,6 @@
}
}
div.logo, div.item {
text-align: bottom;
margin-left: 1em;
@ -41,6 +39,7 @@
}
.profile-header {
padding:10px 20px;
position: relative;
}
.profile-header h2 {

View File

@ -67,7 +67,7 @@
<div id="biography" class="item"></div>
<div><a href="/client#/account/profile" class="add-bio">Edit Bio</a></div>
<div class="item"><a href="/client#/account/profile" class="add-bio">Edit Bio</a></div>
<br clear="all" />
<div class="section-header">Musical Experience</div>
@ -99,7 +99,7 @@
<div class="section-header">Performance Samples</div>
<br clear="all" />
<div id="no-samples" class="left">None specified</div>
<div id="no-samples" class="left item">None specified</div>
<div id="jamkazam-samples" class="left logo">
<img src="/assets/header/logo.png" class="logo" /><br/>
@ -114,13 +114,13 @@
</div>
<br clear="all" />
<div><a href="/client#/account/profile/samples" class="add-recordings">Add Recordings</a></div>
<div class="left item"><a href="/client#/account/profile/samples" class="add-recordings">Add Recordings</a></div>
<br clear="all" />
<br clear="all" />
<div class="section-header">Online Presence</div>
<br clear="all" />
<div id="no-online-presence" class="left">None specified</div>
<div id="no-online-presence" class="left item">None specified</div>
<div id="user-website" class="left logo">
<a rel="external"><img src="/assets/content/website-logo.png" class="logo" /></a>
@ -155,10 +155,10 @@
</div>
<br clear="all" />
<div><a href="/client#/account/profile/samples" class="add-sites">Add Sites</a></div>
<div class="left item"><a href="/client#/account/profile/samples">Add Sites</a></div>
<br clear="all" />
<br clear="all" />
<div class="section-header">Current Interests</div>
<br clear="all" />
<div id="no-interests" class="left item">None specified</div>
@ -212,7 +212,8 @@
</ul>
</div>
</div>
<br clear="all" />
<div class="item"><a href="/client#/account/profile/interests" class="add-interests">Add Interests</a></div>
</div>

View File

@ -11,7 +11,8 @@ describe "Musicians", :js => true, :type => :feature, :capybara_feature => true
let(:fan) { FactoryGirl.create(:fan) }
let(:user) { FactoryGirl.create(:user) }
let(:finder) { FactoryGirl.create(:user) }
let(:claimed_recording) { FactoryGirl.create(:claimed_recording) }
before(:each) do
UserMailer.deliveries.clear
end
@ -24,8 +25,33 @@ describe "Musicians", :js => true, :type => :feature, :capybara_feature => true
it "Basic Test" do
navigate_musician_setup
save_screenshot("setup.png")
expect(page).to have_selector('#user-profile')
expect(page).to have_selector('#user-profile', visible: true)
expect(page).to have_selector('#no-samples', visible: true)
end
end
it "shows Online Presence" do
PerformanceSample.create!(:user_id => user.id, :service_type => "jamkazam", :claimed_recording_id => claimed_recording.id)
PerformanceSample.create!(:user_id => user.id, :service_type => "soundcloud", :service_id => "67890")
PerformanceSample.create!(:user_id => user.id, :service_type => "soundcloud", :service_id => "67891")
navigate_musician_setup
expect(page).to have_selector('#no-samples', visible: true)
expect(page).to have_selector('.jamkazam-playable', count: 1)
expect(page).to have_selector('.twitter-playable', count: 0)
expect(page).to have_selector('.sound-cloud-playable', count: 2)
end
it "shows Performance Samples" do
OnlinePresence.create!({:user_id => user.id, :username => "myonlineusername", :service_type => "facebook"})
OnlinePresence.create!({:user_id => user.id, :username => "myonlineusername", :service_type => "twitter"})
OnlinePresence.create!({:user_id => user.id, :username => "myonlineusername", :service_type => "soundcloud"})
navigate_musician_setup
expect(page).to have_selector('#facebook-presence', visible: true)
expect(page).to have_selector('#soundcloud-presence', visible: true)
expect(page).to have_selector('#twitter-presence', visible: true)
end
end