Sha256: 16c8cf0515619b8015c6aed47b1e48e821cdcd0d8f7c4a4369a9aecc9a857f37

Contents?: true

Size: 976 Bytes

Versions: 8

Compression:

Stored size: 976 Bytes

Contents

require 'spec_helper'

describe 'searching' do
  let!(:file) { FactoryGirl.create(:public_file, title: ["Toothbrush"]) }

  context "as a public user" do
    it "should find the file and have a gallery" do
      visit '/'
      fill_in "search-field-header", with: "Toothbrush"
      click_button "search-submit-header"
      expect(page).to have_content "1 entry found"
      within "#search-results" do
        expect(page).to have_content "Toothbrush"
      end
      
      click_link "Gallery"
      expect(page).to have_content "You searched for: Toothbrush"
      within "#documents" do
        expect(page).to have_content "Toothbrush"
      end
    end

    it "should not display search options for dashboard files" do
      visit "/"
      within(".input-group-btn") do
        expect(page).to_not have_content("My Files")
        expect(page).to_not have_content("My Collections")
        expect(page).to_not have_content("My Shares")
      end
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sufia-6.2.0 spec/features/search_spec.rb
sufia-6.1.0 spec/features/search_spec.rb
sufia-6.0.0 spec/features/search_spec.rb
sufia-6.0.0.rc4 spec/features/search_spec.rb
sufia-6.0.0.rc3 spec/features/search_spec.rb
sufia-6.0.0.rc2 spec/features/search_spec.rb
sufia-6.0.0.rc1 spec/features/search_spec.rb
sufia-6.0.0.beta1 spec/features/search_spec.rb