Skip to content

Commit e87bdd0

Browse files
committed
Revert "Moved success message and updated inbox test"
This reverts commit 416e0e2. Reverting accidental commit to master
1 parent 7d8690d commit e87bdd0

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

app/controllers/inbox_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ def update
4242
elsif params[:delete]
4343
@inbox_comments.each { |i| i.destroy }
4444
end
45-
success_message = ts('Inbox successfully updated.')
4645
rescue
47-
flash[:caution] = ts("Please select something first.")
46+
flash[:caution] = ts("Please select something first")
4847
end
48+
success_message = ts('Inbox successfully updated.')
4949
respond_to do |format|
5050
format.html { redirect_to request.referer || user_inbox_path(@user, page: params[:page], filters: params[:filters]), notice: success_message }
5151
format.json { render json: { item_success_message: success_message }, status: :ok }

spec/controllers/inbox_controller_spec.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,15 +271,19 @@
271271
before { fake_login_known_user(user) }
272272

273273
context "with no comments selected" do
274-
it "redirects to the user's inbox with a caution" do
274+
it "redirects to inbox with caution and a notice" do
275275
put :update, params: { user_id: user.login, read: "yeah" }
276-
it_redirects_to_with_caution(user_inbox_path(user), "Please select something first.")
276+
it_redirects_to_with_caution_and_notice(user_inbox_path(user),
277+
"Please select something first",
278+
"Inbox successfully updated.")
277279
end
278280

279-
it "redirects to the previously viewed page if HTTP_REFERER is set, with a caution" do
281+
it "redirects to the previously viewed page if HTTP_REFERER is set, with a caution and a notice" do
280282
@request.env["HTTP_REFERER"] = root_path
281283
put :update, params: { user_id: user.login, read: "yeah" }
282-
it_redirects_to_with_caution(root_path, "Please select something first.")
284+
it_redirects_to_with_caution_and_notice(root_path,
285+
"Please select something first",
286+
"Inbox successfully updated.")
283287
end
284288
end
285289

0 commit comments

Comments
 (0)