Merge branch 'develop' of bitbucket.org:jamkazam/jam-cloud into develop
This commit is contained in:
commit
eb26c33858
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue