lib/miniblog/rspec/miniblog_shared_examples.rb in miniblog-1.0.0.beta vs lib/miniblog/rspec/miniblog_shared_examples.rb in miniblog-1.0.0

- old
+ new

@@ -49,9 +49,19 @@ expect(page.current_path).to eq admin_post_path(post) expect(post.reload.title).to eq 'A NEW post title' end + it "previews a post" do + visit admin_posts_path + within "#post_#{post.id}" do + click_link 'Edit', match: :first + end + + click_link 'Preview' + expect(page.current_path).to eq admin_preview_path(post) + end + it "deletes a post" do visit admin_posts_path within "#post_#{post.id}" do click_link 'Delete', match: :first