Sha256: 53df2037d14ba1c1e7304155ee8aa64bfcaf5bdd3b559c0aa22cab9d00b0c3a6

Contents?: true

Size: 1013 Bytes

Versions: 8

Compression:

Stored size: 1013 Bytes

Contents

describe "display a work as its owner" do
  let(:work_path) { "/concern/generic_works/#{work.id}" }

  context "as the work owner" do
    let(:work) { create(:work_with_one_file, title: ["Magnificent splendor"], user: user) }
    let(:user) { create(:user) }
    before do
      sign_in user
      visit work_path
    end

    it "shows a work" do
      expect(page).to have_selector 'h1', text: 'Magnificent splendor'

      # Displays FileSets already attached to this work
      within '.related-files' do
        expect(page).to have_selector '.filename', text: 'filename.pdf'
      end
    end
  end

  context "as a user who is not logged in" do
    let(:work) { create(:public_generic_work, title: ["Magnificent splendor"]) }
    before do
      visit work_path
    end

    it "shows a work" do
      expect(page).to have_selector 'h1', text: 'Magnificent splendor'

      # Doesn't have the upload form for uploading more files
      expect(page).not_to have_selector "form#fileupload"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sufia-7.1.0 spec/features/work_show_spec.rb
sufia-7.0.0 spec/features/work_show_spec.rb
sufia-7.0.0.rc2 spec/features/work_show_spec.rb
sufia-7.0.0.rc1 spec/features/work_show_spec.rb
sufia-7.0.0.beta4 spec/features/work_show_spec.rb
sufia-7.0.0.beta3 spec/features/work_show_spec.rb
sufia-7.0.0.beta2 spec/features/work_show_spec.rb
sufia-7.0.0.beta1 spec/features/work_show_spec.rb