Advertisement
Guest User

Untitled

a guest
Mar 10th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.60 KB | None | 0 0
  1. describe 'Authenticated user as author', js: true do
  2.     background do
  3.       sign_in user
  4.       visit question_path(question)
  5.  
  6.       click_on 'Edit question'
  7.     end
  8.  
  9.     scenario 'edit his question' do
  10.       within '.question' do
  11.         fill_in 'Title', with: 'edited title'
  12.         fill_in 'Body', with: 'edited body'
  13.         click_on 'Save question'
  14.  
  15.         expect(page).to_not have_content question.title
  16.         expect(page).to_not have_content question.body
  17.         expect(page).to have_content 'edited title'
  18.         expect(page).to_not have_selector 'textarea'
  19.       end
  20.     end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement