Skip to content

Commit

Permalink
standardrb
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmckissock committed Jun 18, 2024
1 parent ded74d9 commit 0be19ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/controllers/comments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def create
if @comment.save
redirect_to @article
else
@comments = @article.comments.order(created_at: :desc)
render "articles/show", status: :unprocessable_entity
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/controllers/comments_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def setup

describe "when logged in" do
before do
@user = create(:user) #There are errors if I don't add this line. didn't need this in articles_controller_test
log_in_as(@user)
@user = create(:user) # There are errors if I don't add this line. didn't need this in articles_controller_test
log_in_as(@user)
end

it "should create comment when logged in" do
Expand Down

0 comments on commit 0be19ef

Please sign in to comment.