mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-24 09:43:24 -04:00
We deprecated controller and view specs on the grounds that they were brittle, and were a poorer measure of user experience than feature specs. However, feature specs have their own problems: they're much slower to run, and flakier (see #901). We also ran into a few cases where feature specs erroneously passed because they were checking for the presence of a string that occurred in the error page! Hence, we're cautiously un-deprecating controller and view specs. Fixes #1132
18 lines
473 B
Ruby
18 lines
473 B
Ruby
require 'rails_helper'
|
|
|
|
describe "comments/edit" do
|
|
before(:each) do
|
|
controller.stub(:current_user) { nil }
|
|
assign(:comment, FactoryBot.create(:comment))
|
|
end
|
|
|
|
it "renders the edit comment form" do
|
|
render
|
|
|
|
# Run the generator again with the --webrat flag if you want to use webrat matchers
|
|
assert_select "form", action: comments_path(@comment), method: "post" do
|
|
assert_select "textarea#comment_body", name: "comment[body]"
|
|
end
|
|
end
|
|
end
|