Files
growstuff/spec/features/posts/posting_a_post_spec.rb
Brenda Wallace 34b399cd8e Use more signed in contexts in browse crops spec
More member role contexts on alt name spec

More member role contexts in crop feature specs

Don't wrap the shared_context
2019-08-18 16:10:03 +12:00

32 lines
846 B
Ruby

require 'rails_helper'
describe 'Post a post' do
context 'signed in' do
include_context 'signed in member'
before { visit new_post_path }
it "creating a post" do
fill_in "post_subject", with: "Testing"
fill_in "post_body", with: "This is a sample test"
click_button "Post"
expect(page).to have_content "Post was successfully created"
expect(page).to have_content "Posted by"
end
context "editing a post" do
let(:existing_post) { create :post, author: member }
before do
visit edit_post_path(existing_post)
end
it "saving edit" do
fill_in "post_subject", with: "Testing Edit"
click_button "Post"
expect(page).to have_content "Post was successfully updated"
expect(page).to have_content "edited at"
end
end
end
end