From b0fd3fd4c8e5542d4abfc66c5c99b60b05f47b36 Mon Sep 17 00:00:00 2001 From: Steven Miers Date: Mon, 11 May 2015 17:25:57 -0500 Subject: [PATCH] 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. --- web/app/assets/javascripts/profile.js | 4 +-- .../stylesheets/client/profile.css.scss | 5 ++- web/app/views/clients/_profile.html.erb | 15 +++++---- web/spec/features/musician_profile_spec.rb | 32 +++++++++++++++++-- 4 files changed, 41 insertions(+), 15 deletions(-) diff --git a/web/app/assets/javascripts/profile.js b/web/app/assets/javascripts/profile.js index 738c2a99e..3f70e3dcf 100644 --- a/web/app/assets/javascripts/profile.js +++ b/web/app/assets/javascripts/profile.js @@ -567,7 +567,7 @@ } $.each(jamkazamSamples, function(index, sample) { - $jamkazamSamples.append("" + formatTitle(sample.claimed_recording.name) + "
"); + $jamkazamSamples.append("" + formatTitle(sample.claimed_recording.name) + "
"); }); $.each(soundCloudSamples, function(index, sample) { @@ -575,7 +575,7 @@ }); $.each(youTubeSamples, function(index, sample) { - $youTubeSamples.append("" + formatTitle(sample.description) + "
"); + $youTubeSamples.append("" + formatTitle(sample.description) + "
"); }); } } diff --git a/web/app/assets/stylesheets/client/profile.css.scss b/web/app/assets/stylesheets/client/profile.css.scss index a5a7cc70c..5328a80c2 100644 --- a/web/app/assets/stylesheets/client/profile.css.scss +++ b/web/app/assets/stylesheets/client/profile.css.scss @@ -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 { diff --git a/web/app/views/clients/_profile.html.erb b/web/app/views/clients/_profile.html.erb index 5cec630d9..2bbc22804 100644 --- a/web/app/views/clients/_profile.html.erb +++ b/web/app/views/clients/_profile.html.erb @@ -67,7 +67,7 @@
-
Edit Bio
+
Edit Bio

Musical Experience
@@ -99,7 +99,7 @@
Performance Samples

-
None specified
+
None specified

-
Add Recordings
+
Add Recordings


Online Presence

-
None specified
+
None specified

-
Add Sites
+
Add Sites


- +
Current Interests

None specified
@@ -212,7 +212,8 @@ - + +
Add Interests
diff --git a/web/spec/features/musician_profile_spec.rb b/web/spec/features/musician_profile_spec.rb index 3988834fc..36ca57c6c 100644 --- a/web/spec/features/musician_profile_spec.rb +++ b/web/spec/features/musician_profile_spec.rb @@ -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 \ No newline at end of file