Skip to content

Commit

Permalink
Use Poltergeist by default, but Selenium where we have to.
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed Oct 14, 2014
1 parent 3b7a344 commit a573c13
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Expand Up @@ -38,6 +38,8 @@ group :test do
gem 'coveralls', require: false
end

gem 'poltergeist'

# Load local gems according to Refinery developer preference.
if File.exist? local_gemfile = File.expand_path('../.gemfile', __FILE__)
eval File.read(local_gemfile)
Expand Down
10 changes: 10 additions & 0 deletions core/spec/support/javascript_driver_switcher.rb
@@ -0,0 +1,10 @@
RSpec.configure do |config|
config.around(:each, :selenium) do |example|
begin
Capybara.javascript_driver = :selenium
example.call
ensure
Capybara.javascript_driver = :poltergeist
end
end
end
8 changes: 4 additions & 4 deletions pages/spec/features/refinery/admin/pages_spec.rb
Expand Up @@ -135,7 +135,7 @@ module Admin
Refinery::Page.count.should == 1
end

it "includes menu title field", :js => true do
it "includes menu title field", :js, :selenium do
visit refinery.new_admin_page_path

fill_in "Title", :with => "My first page"
Expand Down Expand Up @@ -207,7 +207,7 @@ module Admin
end
end

describe 'Previewing' do
describe 'Previewing', :selenium do
context "an existing page" do
before { Page.create :title => 'Preview me' }

Expand Down Expand Up @@ -622,7 +622,7 @@ module Admin
Refinery::Pages.stub(:new_page_parts).and_return(true)
end

it "deletes page parts" do
it "deletes page parts", :selenium do
visit refinery.edit_admin_page_path(some_page.id)

within "#page_parts" do
Expand Down Expand Up @@ -818,7 +818,7 @@ module Admin
# see https://github.com/refinery/refinerycms/pull/1583
# this test needs to be moved to refinerycms-wymeditor somehow
context "when switching locales" do
specify "dialog has correct links", :js do
specify "dialog has correct links", :js, :selenium do
visit refinery.edit_admin_page_path(about_page)

find("#page_part_body .wym_tools_link a").click
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Expand Up @@ -16,6 +16,7 @@

require 'rspec/rails'
require 'capybara/rspec'
require 'capybara/poltergeist'

Rails.backtrace_cleaner.remove_silencers!

Expand Down

0 comments on commit a573c13

Please sign in to comment.