From c801fa34307e3ecff7795f8afe4038f7ddddaa2a Mon Sep 17 00:00:00 2001 From: nilsding Date: Tue, 18 Nov 2014 20:58:55 +0100 Subject: [PATCH] fixed tests --- spec/features/user_feature_spec.rb | 5 ++--- spec/spec_helper.rb | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/spec/features/user_feature_spec.rb b/spec/features/user_feature_spec.rb index 5a9c7c0a..4cf00539 100644 --- a/spec/features/user_feature_spec.rb +++ b/spec/features/user_feature_spec.rb @@ -9,14 +9,13 @@ feature "User", :type => :feature do scenario "gets asked a question", js: true do visit "/@#{@user1.screen_name}" - page.driver.render Rails.root.join("tmp/#{Time.now.to_i}.png"), full: true + page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_1.png"), full: true fill_in "qb-question", with: Faker::Lorem.sentence click_button "Ask" wait_for_ajax - reload_page - page.driver.render Rails.root.join('tmp'), full: full + page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_2.png"), full: true expect(page).to have_text("Question asked successfully.") end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 919f3d9e..a5f6554f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,10 +1,10 @@ require 'simplecov' SimpleCov.start -# require 'capybara/rails' -# require 'capybara/rspec' require 'capybara/poltergeist' -Capybara.default_driver = :poltergeist +Capybara.register_driver :poltergeist do |app| + Capybara::Poltergeist::Driver.new(app, js_errors: false) +end Capybara.javascript_driver = :poltergeist # This file was generated by the `rails generate rspec:install` command. Conventionally, all