2014-11-17 14:25:28 -08:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
feature "User", :type => :feature do
|
|
|
|
before do
|
|
|
|
@user1 = create(:user)
|
|
|
|
@user2 = create(:user)
|
|
|
|
end
|
|
|
|
|
|
|
|
scenario "gets asked a question", js: true do
|
|
|
|
visit "/@#{@user1.screen_name}"
|
|
|
|
|
2014-11-18 11:58:55 -08:00
|
|
|
page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_1.png"), full: true
|
2014-11-17 14:25:28 -08:00
|
|
|
|
|
|
|
fill_in "qb-question", with: Faker::Lorem.sentence
|
|
|
|
click_button "Ask"
|
|
|
|
wait_for_ajax
|
|
|
|
|
2014-11-18 11:58:55 -08:00
|
|
|
page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_2.png"), full: true
|
2014-11-17 14:25:28 -08:00
|
|
|
|
|
|
|
expect(page).to have_text("Question asked successfully.")
|
|
|
|
end
|
|
|
|
end
|