Revert to 'rspec fixes' -- 'Inbox user answers a question' is a mysterious failure

This commit is contained in:
Yuki 2015-05-11 16:09:12 +05:30
parent b543c35665
commit 3d2b884b74
3 changed files with 10 additions and 11 deletions

View File

@ -1,7 +1,7 @@
language: ruby language: ruby
rvm: 2.0.0 rvm: 2.1
before_script: before_script:
- cp config/database.yml.postgres config/database.yml - cp config/database.yml.postgres config/database.yml
- cp config/justask.yml.example config/justask.yml - cp config/justask.yml.example config/justask.yml
- bundle exec rake db:setup - bundle exec rake db:setup
- bundle exec rake db:migrate - bundle exec rake db:migrate

View File

@ -15,14 +15,14 @@ items_per_page: 10
# OAuth tokens # OAuth tokens
sharing: sharing:
twitter: twitter:
enabled: false enabled: true
# Get the tokens from https://apps.twitter.com # Get the tokens from https://apps.twitter.com
consumer_key: '' consumer_key: ''
consumer_secret: '' consumer_secret: ''
facebook: facebook:
enabled: false enabled: false
tumblr: tumblr:
enabled: false enabled: true
# Get the tokens from https://www.tumblr.com/oauth/apps # Get the tokens from https://www.tumblr.com/oauth/apps
consumer_key: '' consumer_key: ''
consumer_secret: '' consumer_secret: ''

View File

@ -25,22 +25,21 @@ feature "Inbox", :devise do
login_as me, scope: :user login_as me, scope: :user
visit root_path visit root_path
expect(page).to have_text('1 new question'.upcase) expect(page).to have_text('1 new question'.upcase)
page.driver.render Rails.root.join("tmp/answer_#{Time.now.to_i}_1.png"), full: true page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_1.png"), full: true
click_link "Inbox" click_link "Inbox"
expect(page).to have_text(question.content) expect(page).to have_text(question.content)
expect(page).to have_field('ib-answer', wait: 2) fill_in "ib-answer", with: Faker::Lorem.sentence
fill_in "ib-answer", with: "This is an answer. I'm number i!" page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_2.png"), full: true
page.driver.render Rails.root.join("tmp/answer_#{Time.now.to_i}_2.png"), full: true
click_button "Answer" click_button "Answer"
wait_for_ajax wait_for_ajax
expect(page).not_to have_text(question.content, wait: 2) expect(page).not_to have_text(question.content)
page.driver.render Rails.root.join("tmp/answer_#{Time.now.to_i}_3.png"), full: true page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_3.png"), full: true
visit show_user_profile_path(me.screen_name) visit show_user_profile_path(me.screen_name)
expect(page).to have_text(question.content) expect(page).to have_text(question.content)
page.driver.render Rails.root.join("tmp/answer_#{Time.now.to_i}_4.png"), full: true page.driver.render Rails.root.join("tmp/#{Time.now.to_i}_4.png"), full: true
end end
# Scenario: User generates new question # Scenario: User generates new question