Fix test failures for jam_track rights.

This commit is contained in:
Steven Miers 2015-01-05 19:02:48 -06:00
parent 6906e4454a
commit 02aef2fe17
1 changed files with 4 additions and 3 deletions

View File

@ -105,19 +105,20 @@ describe JamTrackRight do
end
it "bogus key" do
JamTrackRight.list_keys(user, ['a']).should eq([])
JamTrackRight.list_keys(user, [2112]).should eq([])
end
it "valid track with no rights to it by querying user" do
jam_track = FactoryGirl.create(:jam_track)
keys = JamTrackRight.list_keys(user, [jam_track.id])
keys.length.should == 0
keys.should have(1).items
keys[0]['private_key'].should be_nil
end
it "valid track with rights to it by querying user" do
jam_track_right = FactoryGirl.create(:jam_track_right, private_key: 'keyabc')
keys = JamTrackRight.list_keys(jam_track_right.user, [jam_track_right.jam_track.id])
keys.length.should == 1
keys.should have(1).items
keys[0].id.should == jam_track_right.jam_track.id
keys[0]['private_key'].should eq('keyabc')
end