Sha256: 3c1f7b3eed9b46b0af4ca5bc6e49691cd8b2b119896cd70844db50208a6ce975

Contents?: true

Size: 937 Bytes

Versions: 10

Compression:

Stored size: 937 Bytes

Contents

require 'spec_helper'

describe "select representative file for work" do
  let!(:user) { FactoryGirl.create(:user) }
  let!(:file1){ FactoryGirl.create(:generic_file, title: ["Sample file 1"] ) }
  let!(:file2){ FactoryGirl.create(:generic_file, title: ["Sample file 2"] ) }
  let!(:work1) { FactoryGirl.create(:generic_work, user: user, title: 'Work 1' ) }
  
  context "when a file is selected from the dropbox and saved" do
    it "should be persisted" do
      login_as(user)
      work1.representative.should == nil

      work1.generic_files << file1
      work1.generic_files << file2

      visit edit_curation_concern_generic_work_path(work1)
      select file2.title.first, from: "generic_work[representative]"
      select "All rights reserved", from: "generic_work[rights]"
      click_button "Update Generic work"

      reload = GenericWork.find(work1.pid)
      reload.representative.should == file2.pid
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
curate-0.6.6 spec/features/select_representative_spec.rb
curate-0.6.5 spec/features/select_representative_spec.rb
curate-0.6.4 spec/features/select_representative_spec.rb
curate-0.6.3 spec/features/select_representative_spec.rb
curate-0.6.1 spec/features/select_representative_spec.rb
curate-0.6.0 spec/features/select_representative_spec.rb
curate-0.5.6 spec/features/select_representative_spec.rb
curate-0.5.5 spec/features/select_representative_spec.rb
curate-0.5.4 spec/features/select_representative_spec.rb
curate-0.5.2 spec/features/select_representative_spec.rb