fixed tests

This commit is contained in:
nilsding 2014-11-18 20:58:55 +01:00
parent c4d48190b6
commit c801fa3430
2 changed files with 5 additions and 6 deletions

View File

@ -9,14 +9,13 @@ feature "User", :type => :feature do
scenario "gets asked a question", js: true do scenario "gets asked a question", js: true do
visit "/@#{@user1.screen_name}" 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 fill_in "qb-question", with: Faker::Lorem.sentence
click_button "Ask" click_button "Ask"
wait_for_ajax 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.") expect(page).to have_text("Question asked successfully.")
end end

View File

@ -1,10 +1,10 @@
require 'simplecov' require 'simplecov'
SimpleCov.start SimpleCov.start
# require 'capybara/rails'
# require 'capybara/rspec'
require 'capybara/poltergeist' 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 Capybara.javascript_driver = :poltergeist
# This file was generated by the `rails generate rspec:install` command. Conventionally, all # This file was generated by the `rails generate rspec:install` command. Conventionally, all