Sha256: 8144aa1679889cacb1d8d72167632f29b8d19c6b0d35968545e47874a4d848ac

Contents?: true

Size: 1.46 KB

Versions: 3

Compression:

Stored size: 1.46 KB

Contents

require "spec_helper"

feature "Block controls" do
  let(:exhibit) { FactoryGirl.create(:exhibit) }
  let(:exhibit_curator) { FactoryGirl.create(:exhibit_curator, exhibit: exhibit) }
  before { login_as exhibit_curator }

  scenario "should be split into separate sections", :js => true do
    skip("Passing locally but Travis is throwing intermittent error because it doesn't seem to wait for form to be submitted.") if ENV["CI"]
    # create page
    visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page)
    click_link exhibit_curator.email
    within '#user-util-collapse .dropdown' do
      click_link 'Dashboard'
    end
    click_link "Feature pages"

    add_new_page_via_button("My New Feature Page")

    expect(page).to have_css("h3", text: "My New Feature Page")

    expect(page).to have_content("The feature page was created.")
    within("li.dd-item") do
      click_link "Edit"
    end
    # fill in title
    fill_in "feature_page_title", :with => "Exhibit Title"
    # click to add widget
    add_widget

    within('.st-block-controls') do
      expect(page).to have_css(".st-controls-group", count: 2)
      within(first('.st-controls-group')) do
        expect(page).to have_content "Standard widgets"
        expect(page).to have_css('a.st-block-control')
      end
      within(all('.st-controls-group').last) do
        expect(page).to have_content "Exhibit item widgets"
        expect(page).to have_css('a.st-block-control')
      end
    end


  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
blacklight-spotlight-0.3.1 spec/features/javascript/block_controls_spec.rb
blacklight-spotlight-0.3.0 spec/features/javascript/block_controls_spec.rb
blacklight-spotlight-0.2.0 spec/features/javascript/block_controls_spec.rb