-
-
Save lmiller1990/ffbfb83863cbfdd909fd3161d743a3a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rails_helper' | |
feature 'Posts', type: :system, js: true do | |
let!(:category) { create(:category) } | |
context 'the post is valid' do | |
it 'creates a post' do | |
visit new_post_url | |
fill_in 'post_title', with: 'my great post' | |
fill_in 'post_body', with: 'body' | |
select category.name, from: 'post[category_id]' | |
click_on 'Create Post' | |
Post.all.reload | |
expect(Post.count).to eq 1 | |
expect(Post.first.title).to eq 'my great post' | |
expect(page).to have_content('my great post') | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment