VRFS-1465 add tests

This commit is contained in:
Brian Smith 2014-04-03 00:19:39 -04:00
parent b17dafd94f
commit 7e8b6eb238
4 changed files with 98 additions and 7 deletions

View File

@ -3,31 +3,33 @@ module JamRuby
MAP_ICON_NAME = {
"accordion" => "accordion",
"acoustic guitar" => "acoustic",
"acoustic guitar" => "acoustic_guitar",
"banjo" => "banjo",
"bass guitar" => "bass",
"bass guitar" => "bass_guitar",
"cello" => "cello",
"clarinet" => "clarinet",
"computer" => "computer",
"default" => "default",
"drums" => "drums",
"electric guitar" => "guitar",
"electric guitar" => "electric_guitar",
"euphonium" => "euphonium",
"flute" => "flute",
"french horn" => "frenchhorn",
"french horn" => "french_horn",
"harmonica" => "harmonica",
"keyboard" => "keyboard",
"mandolin" => "mandolin",
"oboe" => "oboe",
"other" => "other",
"piano" => "piano",
"saxophone" => "saxophone",
"trombone" => "trombone",
"trumpet" => "trumpet",
"tuba" => "tuba",
"ukulele" => "ukelele",
"upright bass" => "upright_bass",
"viola" => "viola",
"violin" => "violin",
"voice" => "vocals"
"voice" => "voice"
}
self.primary_key = 'id'

View File

@ -171,7 +171,7 @@
// do nothing when entering the bubble (this should never happen)
},
function () {
$(this).fadeOut(500);
$(this).fadeOut(100);
}
);
}

View File

@ -20,7 +20,7 @@ describe "Account", :js => true, :type => :feature, :capybara_feature => true do
find('div.account-mid.identity')
end
it { should have_selector('h1', text: 'my account') }
it { should have_selector('h1', text: 'my account') }
describe "identity" do
before(:each) do

View File

@ -0,0 +1,89 @@
require 'spec_helper'
describe "Feed", :js => true, :type => :feature, :capybara_feature => true do
before(:each) do
Capybara.javascript_driver = :poltergeist
Capybara.current_driver = Capybara.javascript_driver
@user = FactoryGirl.create(:user)
inst2 = MusicianInstrument.new
inst2.instrument = Instrument.find('drums')
inst2.proficiency_level = 2
inst2.priority = 1
@user.musician_instruments << inst2
end
describe "sessions" do
before(:each) do
create_session(@user)
formal_leave_by(@user)
end
# it "should render avatar" do
# end
# it "should render description" do
# end
# it "should render stats" do
# end
it "should render details" do
visit "/client#/feed"
# confirm user avatar exists
# confirm user name exists
# confirm instrument icons exist
find("img[instrument-id=\"electric guitar\"]")
find("img[instrument-id=\"drums\"]")
end
# it "should render play widget" do
# end
end
describe "recordings" do
before(:each) do
start_recording_with(@user)
stop_recording
formal_leave_by(@user)
end
# it "should render avatar" do
# end
# it "should render description" do
# end
# it "should render stats" do
# end
it "should render details" do
visit "/client#/feed"
# confirm user avatar exists
# confirm user name exists
# confirm instrument icons exist
find("img[instrument-id=\"electric guitar\"]")
find("img[instrument-id=\"drums\"]")
end
# it "should render play widget" do
# it " and allow recording playback" do
# end
# end
end
end