Skip to content

Instantly share code, notes, and snippets.

@amalrik
Created March 2, 2019 13:28
Show Gist options
  • Save amalrik/9fc529d55414520bb2268ab2c7a31732 to your computer and use it in GitHub Desktop.
Save amalrik/9fc529d55414520bb2268ab2c7a31732 to your computer and use it in GitHub Desktop.
Using Page Object Pattern in rspec - final code
it "can create posts -page object pattern" do
new_post_form = NewPostForm.new
new_post_form.login(user).visit_page.fill_in_with(
post_title: "My super Blog title",
post_input_content: "##loren loren\n ipsum ipsum"
).submit
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