Skip to content

Instantly share code, notes, and snippets.

@amalrik
Created March 2, 2019 13:23
Show Gist options
  • Save amalrik/a615a2355e01099a41b2dc76532da4e5 to your computer and use it in GitHub Desktop.
Save amalrik/a615a2355e01099a41b2dc76532da4e5 to your computer and use it in GitHub Desktop.
Using Page Object Pattern in rspec - sample1
it "can create posts" do
login_as(user, :scope => :user)
visit new_post_path
within("#new_post") do
fill_in 'post_title', with: "My super Blog title"
fill_in 'post_input_content', with: "##loren loren\n ipsum ipsum"
end
click_button 'Publish'
expect(page).to have_content 'Post was successfully created'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment