Sha256: 51f44d31c5cc64637806f0bf0ab35bbf83fd9f054d23c5033573782d30365aab

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

describe "Browse files", :type => :feature do

  before :all do
    cleanup_jetty
    @fixtures = find_or_create_file_fixtures
    @fixtures[0].tag = ["key"]
    (1..25).each do |i|
      @fixtures[0].tag << i
    end
    @fixtures[0].save
  end

  after :all do
    cleanup_jetty
  end

  before do
    allow(User).to receive(:find_by_user_key).and_return(stub_model(User, twitter_handle: 'bob'))
    visit '/'
    fill_in "search-field-header", with: "key"
    click_button "search-submit-header"
    click_link "Keyword"
    click_link "more Keywords»"
  end

  describe "when not logged in" do
    it "should let us browse some of the fixtures" do
      click_link "18"
      expect(page).to have_content "Search Results"
      click_link @fixtures[0].title[0]
      expect(page).to have_content "Download"
      expect(page).not_to have_content "Edit"
    end
    it "should allow you to click next" do
      click_link 'Next »'
      within(".modal-body") do
        expect(page).to have_content "5"
        expect(page).not_to have_content "11"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sufia-4.2.0 spec/features/browse_files_spec.rb
sufia-4.1.0 spec/features/browse_files_spec.rb