VRFS-2473 : Add metronome feature tests.

This commit is contained in:
Steven Miers 2015-02-15 14:44:38 -06:00
parent c52c429e96
commit 8a737b3556
2 changed files with 21 additions and 1 deletions

View File

@ -765,7 +765,7 @@
function getPeerState(clientId) {
return {
ntp_stable: Math.random() > 0.2
ntp_stable: Math.random() > 0.5
}
}

View File

@ -111,6 +111,26 @@ describe "In a Session", :js => true, :type => :feature, :capybara_feature => tr
end
end
specify "metronome" do
user = FactoryGirl.create(:user)
invitee = FactoryGirl.create(:user)
FactoryGirl.create(:friendship, :user => user, :friend => invitee)
in_client(user) do
create_session
# Call it 10 times. The fake jam client will randomly ntp_stable:false 50% of the time
10.times do
find('#open-a-metronome').trigger(:click)
end
sleep(2)
# we should have received an error one of the times, but it should open eventually:
find('#notification').should have_text("Couldn't open metronome")
expect(page).to have_selector('.track-label[title="Metronome"]')
#save_screenshot("metro.png")
end
end
specify "invitee receives notification when creator invites musician" do
pending "blocked on testing this via front-end - fakeJamClient doesn't support invite UX"
user = FactoryGirl.create(:user)