spec/auth/ability_spec.rb in ddr-models-3.0.0.beta.16 vs spec/auth/ability_spec.rb in ddr-models-3.0.0.beta.17

- old
+ new

@@ -17,11 +17,11 @@ describe "Datastream abilities" do let(:obj) { FactoryGirl.create(:component) } DatastreamAbilityDefinitions::DATASTREAM_DOWNLOAD_ABILITIES.each do |dsid, permission| describe "\"#{dsid}\"" do - let(:ds) { obj.datastreams[dsid] } + let(:ds) { obj.attached_files[dsid] } describe "can #{permission.inspect} object" do before { subject.can permission, obj.id } it { should be_able_to(:download, ds) } end describe "cannot #{permission.inspect} object" do @@ -29,13 +29,13 @@ it { should_not be_able_to(:download, ds) } end end end - describe "non-downloadable datastreams" do + describe "non-downloadable attached_files" do (Component.ds_specs.keys.map(&:to_s) - DatastreamAbilityDefinitions::DATASTREAM_DOWNLOAD_ABILITIES.keys).each do |dsid| describe "\"#{dsid}\"" do - let(:ds) { obj.datastreams[dsid] } + let(:ds) { obj.attached_files[dsid] } before { subject.can :download, obj.id } it { should_not be_able_to(:download, ds) } end end end