195 lines
5.2 KiB
Ruby
195 lines
5.2 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe "Feed", :js => true, :type => :feature, :capybara_feature => true do
|
|
|
|
let (:user) { FactoryGirl.create(:user) }
|
|
|
|
before(:each) do
|
|
MusicSession.delete_all
|
|
Recording.delete_all
|
|
end
|
|
|
|
|
|
describe "regressions" do
|
|
|
|
describe "mount" do
|
|
|
|
it "should render when has mount" do
|
|
# regression for VRFS-1987
|
|
ams = FactoryGirl.create(:active_music_session)
|
|
FactoryGirl.create(:icecast_mount, music_session_id: ams.id)
|
|
|
|
fast_signin user, "/client#/feed"
|
|
find('#feedScreen')
|
|
|
|
find(".feed-entry.music-session-history-entry[data-music-session='#{ams.id}']")
|
|
end
|
|
end
|
|
end
|
|
describe "sessions" do
|
|
|
|
before(:each) do
|
|
create_session(creator: user)
|
|
formal_leave_by(user)
|
|
end
|
|
|
|
# it "should render avatar" do
|
|
# it " and link to profile" do
|
|
# end
|
|
|
|
# it " and render artist hover bubble" do
|
|
# end
|
|
# end
|
|
|
|
# it "should render description" do
|
|
# it " and link to session landing" do
|
|
# end
|
|
|
|
# it " and render session hover bubble" do
|
|
# end
|
|
# end
|
|
|
|
# it "should render artist name" do
|
|
# it " and link to profile" do
|
|
# end
|
|
|
|
# it " and render artist hover bubble"
|
|
# end
|
|
|
|
|
|
it "should render stats" do
|
|
visit "/client#/feed"
|
|
|
|
# initial stats
|
|
find('span.plays').should have_content('0')
|
|
find('span.comments').should have_content('0')
|
|
find('span.likes').should have_content('0')
|
|
|
|
# Comments
|
|
find('a.btn-comment').trigger(:click)
|
|
comment = 'this sounds great'
|
|
fill_in "txtComment", with: comment
|
|
find('#btn-add-comment').trigger(:click)
|
|
find('div.comment-text', text: comment)
|
|
find('#dialog-close-button', '[layout-id="comment-dialog"]').trigger(:click)
|
|
|
|
find('[layout-id="feed"] .btn-refresh-entries').trigger(:click)
|
|
find('span.comments').should have_content('1')
|
|
|
|
# Likes
|
|
find('a.btn-like').trigger(:click)
|
|
find('span.likes').should have_content('1')
|
|
end
|
|
|
|
it "should render details" do
|
|
visit "/client#/feed"
|
|
find('.feed-details a.details').trigger(:click)
|
|
|
|
# confirm user avatar exists
|
|
find("a.avatar-tiny[user-id=\"#{user.id}\"][hoveraction=\"musician\"] img")
|
|
|
|
# confirm user name exists
|
|
find("a.musician-name[user-id=\"#{user.id}\"][hoveraction=\"musician\"]", text: user.name)
|
|
|
|
# confirm instrument icons exist
|
|
find("img[instrument-id=\"electric guitar\"]")
|
|
|
|
# confirm hover bubbles show
|
|
find("a.avatar-tiny[user-id=\"#{user.id}\"][hoveraction=\"musician\"]").hover_intent
|
|
|
|
# confirm navigate to user profile page
|
|
find(".avatar-tiny[user-id=\"#{user.id}\"][hoveraction=\"musician\"]").trigger(:click)
|
|
find("#user-profile h2[id=profile-username]", text: user.name)
|
|
end
|
|
|
|
# it "should render play widget" do
|
|
# end
|
|
|
|
end
|
|
|
|
describe "recordings" do
|
|
|
|
before(:each) do
|
|
start_recording_with(user)
|
|
stop_recording
|
|
claim_recording("my recording", "my recording description")
|
|
formal_leave_by(user)
|
|
MusicSession.delete_all
|
|
end
|
|
|
|
# it "should render avatar" do
|
|
# it " and link to profile" do
|
|
# end
|
|
|
|
# it " and render artist hover bubble" do
|
|
# end
|
|
# end
|
|
|
|
# it "should render description" do
|
|
# it " and link to recording landing" do
|
|
# end
|
|
|
|
# it " and render recording hover bubble" do
|
|
# end
|
|
# end
|
|
|
|
# it "should render artist name" do
|
|
# it " and link to profile" do
|
|
# end
|
|
|
|
# it " and render artist hover bubble"
|
|
# end
|
|
|
|
it "should render stats" do
|
|
visit "/client#/feed"
|
|
|
|
# initial stats
|
|
find('span.plays').should have_content('0')
|
|
find('span.comments').should have_content('0')
|
|
find('span.likes').should have_content('0')
|
|
|
|
# ensure Share icon exists
|
|
find('a.btn-share')
|
|
|
|
# Comments
|
|
find('a.btn-comment').trigger(:click)
|
|
comment = 'this sounds great'
|
|
fill_in "txtComment", with: comment
|
|
find('#btn-add-comment').trigger(:click)
|
|
find('div.comment-text', text: comment)
|
|
find('#dialog-close-button', '[layout-id="comment-dialog"]').trigger(:click)
|
|
|
|
find('[layout-id="feed"] .btn-refresh-entries').trigger(:click)
|
|
find('span.comments').should have_content('1')
|
|
|
|
# Likes
|
|
find('a.btn-like').trigger(:click)
|
|
find('span.likes').should have_content('1')
|
|
end
|
|
|
|
it "should render details" do
|
|
visit "/client#/feed"
|
|
|
|
find('.feed-details a.details').trigger(:click)
|
|
|
|
# confirm user avatar exists
|
|
find("a.avatar-tiny[user-id=\"#{user.id}\"][hoveraction=\"musician\"] img")
|
|
|
|
# confirm user name exists
|
|
find("a.musician-name[user-id=\"#{user.id}\"][hoveraction=\"musician\"]", text: user.name)
|
|
|
|
# confirm instrument icons exist
|
|
find("img[instrument-id=\"electric guitar\"]")
|
|
|
|
|
|
# confirm hover bubbles show
|
|
find("a.avatar-tiny[user-id=\"#{user.id}\"][hoveraction=\"musician\"]").hover_intent
|
|
|
|
# confirm navigate to user profile page
|
|
find(".avatar-tiny[user-id=\"#{user.id}\"][hoveraction=\"musician\"]").trigger(:click)
|
|
find("#user-profile h2[id=profile-username]", text: user.name)
|
|
end
|
|
|
|
end
|
|
|
|
end |