Skip to content

Commit

Permalink
AO3-6709 fix issues with renaming variable
Browse files Browse the repository at this point in the history
  • Loading branch information
nish-shai-scacap committed Jul 22, 2024
1 parent ec94a83 commit 4ce18a7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions config/locales/controllers/en.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
en:
admin:
access:
action_access_denied: Sorry, only an authorized admin can do that.
page_access_denied: Sorry, only an authorized admin can access the page you were trying to reach.
admin_invitations:
find:
user_not_found: No results were found. Try another search.
invite_from_queue:
success:
one: "%{count} person from the invite queue is being invited."
other: "%{count} people from the invite queue are being invited."
access:
page_access_denied: Sorry, only an authorized admin can access the page you were trying to reach.
action_access_denied: Sorry, only an authorized admin can do that.
blocked:
users:
create:
Expand Down
28 changes: 14 additions & 14 deletions spec/controllers/inbox_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,36 +294,36 @@
it "marks all as read and redirects to inbox with a notice" do
parameters = {
user_id: user.login,
inbox_comments: [inbox_comment_1.id, inbox_comment_2.id],
inbox_comments: [inbox_comment1.id, inbox_comment2.id],
read: "yeah"
}

put :update, params: parameters
it_redirects_to_with_notice(user_inbox_path(user), "Inbox successfully updated.")

inbox_comment_1.reload
expect(inbox_comment_1.read).to be_truthy
inbox_comment_2.reload
expect(inbox_comment_2.read).to be_truthy
inbox_comment1.reload
expect(inbox_comment1.read).to be_truthy
inbox_comment2.reload
expect(inbox_comment2.read).to be_truthy
end

it "marks one as read and redirects to inbox with a notice" do
put :update, params: { user_id: user.login, inbox_comments: [inbox_comment_1.id], read: "yeah" }
put :update, params: { user_id: user.login, inbox_comments: [inbox_comment1.id], read: "yeah" }
it_redirects_to_with_notice(user_inbox_path(user), "Inbox successfully updated.")

inbox_comment_1.reload
expect(inbox_comment_1.read).to be_truthy
inbox_comment_2.reload
expect(inbox_comment_2.read).to be_falsy
inbox_comment1.reload
expect(inbox_comment1.read).to be_truthy
inbox_comment2.reload
expect(inbox_comment2.read).to be_falsy
end

it "deletes one and redirects to inbox with a notice" do
put :update, params: { user_id: user.login, inbox_comments: [inbox_comment_1.id], delete: "yeah" }
put :update, params: { user_id: user.login, inbox_comments: [inbox_comment1.id], delete: "yeah" }
it_redirects_to_with_notice(user_inbox_path(user), "Inbox successfully updated.")

expect(InboxComment.find_by(id: inbox_comment_1.id)).to be_nil
inbox_comment_2.reload
expect(inbox_comment_2.read).to be_falsy
expect(InboxComment.find_by(id: inbox_comment1.id)).to be_nil
inbox_comment2.reload
expect(inbox_comment2.read).to be_falsy
end
end

Expand Down

0 comments on commit 4ce18a7

Please sign in to comment.