A platform for community discussion. Free, open, simple.
DEV: Assert for 200 response code to avoid changing magic helper in the future.
Guo Xiang Tan3a8f69c3d2c9
diff --git a/plugins/poll/spec/controllers/posts_controller_spec.rb b/plugins/poll/spec/controllers/posts_controller_spec.rbindex 917592e53c2..96ccc97e7c2 100644--- a/plugins/poll/spec/controllers/posts_controller_spec.rb+++ b/plugins/poll/spec/controllers/posts_controller_spec.rb@@ -16,7 +16,7 @@ describe PostsController dotitle: title, raw: "[poll]\n- A\n- B\n[/poll]"}, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["cooked"]).to match("data-poll-")expect(json["polls"]["poll"]).to be@@ -29,7 +29,7 @@ describe PostsController dotopic_id: post_1.topic.id, raw: "[poll]\n- A\n- B\n[/poll]"}, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["cooked"]).to match("data-poll-")expect(json["polls"]["poll"]).to be@@ -43,7 +43,7 @@ describe PostsController dotitle: title, raw: "[poll name=#{name} close=#{close_date.iso8601}]\n- A\n- B\n[/poll]"}, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["polls"][name]["close"]).to be@@ -99,7 +99,7 @@ describe PostsController dotitle: title, raw: "[poll name=<script>alert('xss')</script>]\n- A\n- B\n[/poll]"}, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["cooked"]).to match("data-poll-")expect(json["cooked"]).to include("<script>")@@ -111,7 +111,7 @@ describe PostsController dotitle: title, raw: "[Polls are awesome](/foobar)\n[poll]\n- A\n- B\n[/poll]"}, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["cooked"]).to match("data-poll-")expect(json["polls"]).to be@@ -122,7 +122,7 @@ describe PostsController dotitle: title, raw: "[poll name=1]\n- A\n[poll name=2]\n- B\n- C\n[/poll]\n- D\n[/poll]"}, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["cooked"]).to match("data-poll-")expect(json["polls"]["1"]).to_not be@@ -148,7 +148,7 @@ describe PostsController doid: post_id, post: { raw: "[poll]\n- A\n- B\n- C\n[/poll]" }}, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["post"]["polls"]["poll"]["options"][2]["html"]).to eq("C")end@@ -160,7 +160,7 @@ describe PostsController doid: post_id, post: { raw: "[poll]\n- A\n- B\n- C\n[/poll]" }}, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["post"]["polls_votes"]).to_not beend@@ -196,7 +196,7 @@ describe PostsController doid: post_id, post: { raw: new_option }}, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["post"]["polls"]["poll"]["options"][1]["html"]).to eq("C")end@@ -208,14 +208,14 @@ describe PostsController doid: post_id, post: { raw: new_option }}, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["post"]["polls"]["poll"]["options"][1]["html"]).to eq("C")endit "support changes on the post" doput :update, params: { id: post_id, post: { raw: updated } }, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["post"]["cooked"]).to match("before")end@@ -248,7 +248,7 @@ describe PostsController doid: post_id, post: { raw: new_option }}, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["post"]["polls"]["poll"]["options"][1]["html"]).to eq("C")expect(json["post"]["polls"]["poll"]["voters"]).to eq(1)@@ -267,7 +267,7 @@ describe PostsController doid: post_id, post: { raw: new_option }}, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["post"]["polls"]["poll"]["options"][1]["html"]).to eq("C")@@ -278,7 +278,7 @@ describe PostsController doit "support changes on the post" doput :update, params: { id: post_id, post: { raw: updated } }, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["post"]["cooked"]).to match("before")end@@ -322,7 +322,7 @@ describe PostsController dotitle: title, raw: "[poll]\n- A\n- B\n[/poll]\n[poll name=foo]\n- A\n- B\n[/poll]"}, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["cooked"]).to match("data-poll-")expect(json["polls"]["poll"]).to be@@ -363,7 +363,7 @@ describe PostsController dotitle: title, raw: "[poll]\n- A\n- B\n[/poll]"}, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["cooked"]).to eq("<p>[poll]</p>\n<ul>\n<li>A</li>\n<li>B<br>\n[/poll]</li>\n</ul>")end@@ -399,7 +399,7 @@ describe PostsController dotitle: title, raw: "[poll]\n- A\n- B\n[/poll]"}, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["cooked"]).to match("data-poll-")expect(json["polls"]["poll"]).to be@@ -418,7 +418,7 @@ describe PostsController dotitle: title, raw: "[poll]\n- A\n- B\n[/poll]"}, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["cooked"]).to match("data-poll-")expect(json["polls"]["poll"]).to be@@ -437,7 +437,7 @@ describe PostsController dotitle: title, raw: "[poll]\n- A\n- B\n[/poll]"}, format: :json- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["cooked"]).to match("data-poll-")expect(json["polls"]["poll"]).to bediff --git a/spec/controllers/admin/api_controller_spec.rb b/spec/controllers/admin/api_controller_spec.rbindex 27d73ea3ea1..48f63ed739b 100644--- a/spec/controllers/admin/api_controller_spec.rb+++ b/spec/controllers/admin/api_controller_spec.rb@@ -11,7 +11,7 @@ describe Admin::ApiController docontext '.index' doit "succeeds" doget :index, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)endenddiff --git a/spec/controllers/admin/backups_controller_spec.rb b/spec/controllers/admin/backups_controller_spec.rbindex a4f1757a464..f3ebecd1476 100644--- a/spec/controllers/admin/backups_controller_spec.rb+++ b/spec/controllers/admin/backups_controller_spec.rb@@ -28,7 +28,7 @@ describe Admin::BackupsController doget :index, format: :html, xhr: true- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -40,7 +40,7 @@ describe Admin::BackupsController doget :index, format: :json, xhr: true- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json[0]["filename"]).to eq("backup1")@@ -58,7 +58,7 @@ describe Admin::BackupsController doget :status, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -72,7 +72,7 @@ describe Admin::BackupsController dowith_uploads: false, client_id: "foo"}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -139,7 +139,7 @@ describe Admin::BackupsController dodelete :destroy, params: { id: backup_filename }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)endit "doesn't remove the backup if not found" do@@ -162,7 +162,7 @@ describe Admin::BackupsController doget :logs, format: :html, xhr: true- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -175,7 +175,7 @@ describe Admin::BackupsController dopost :restore, params: { id: backup_filename, client_id: "foo" }, format: :jsonexpect(SiteSetting.disable_emails).to eq(true)- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -188,7 +188,7 @@ describe Admin::BackupsController doexpect { put :readonly, params: { enable: true }, format: :json }.to change { UserHistory.count }.by(1)- expect(response).to be_successful+ expect(response.status).to eq(200)user_history = UserHistory.last@@ -202,7 +202,7 @@ describe Admin::BackupsController doexpect { put :readonly, params: { enable: false }, format: :json }.to change { UserHistory.count }.by(1)- expect(response).to be_successful+ expect(response.status).to eq(200)user_history = UserHistory.lastdiff --git a/spec/controllers/admin/badges_controller_spec.rb b/spec/controllers/admin/badges_controller_spec.rbindex 6751072d3a4..441d366f087 100644--- a/spec/controllers/admin/badges_controller_spec.rb+++ b/spec/controllers/admin/badges_controller_spec.rb@@ -9,7 +9,7 @@ describe Admin::BadgesController docontext 'index' doit 'returns badge index' doget :index, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -79,7 +79,7 @@ describe Admin::BadgesController doit 'returns JSON' doget :badge_types, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)expect(::JSON.parse(response.body)["badge_types"]).to be_presentendend@@ -87,7 +87,7 @@ describe Admin::BadgesController docontext '.destroy' doit 'deletes the badge' dodelete :destroy, params: { id: badge.id }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)expect(Badge.where(id: badge.id).exists?).to eq(false)expect(UserHistory.where(acting_user_id: user.id, action: UserHistory.actions[:delete_badge]).exists?).to eq(true)end@@ -104,7 +104,7 @@ describe Admin::BadgesController doname: "123456"}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)editor_badge.reloadexpect(editor_badge.name).to eq(editor_badge_name)@@ -127,7 +127,7 @@ describe Admin::BadgesController doenabled: true}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)badge.reloadexpect(badge.name).to eq('123456')expect(badge.query).to eq('select 123')@@ -147,7 +147,7 @@ describe Admin::BadgesController doenabled: true}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)badge.reloadexpect(badge.name).to eq('123456')expect(badge.query).to eq(sql)diff --git a/spec/controllers/admin/color_schemes_controller_spec.rb b/spec/controllers/admin/color_schemes_controller_spec.rbindex e748d1e002c..efc1a488108 100644--- a/spec/controllers/admin/color_schemes_controller_spec.rb+++ b/spec/controllers/admin/color_schemes_controller_spec.rb@@ -21,7 +21,7 @@ describe Admin::ColorSchemesController doFabricate(:color_scheme)get :index, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)expect(::JSON.parse(response.body)).to be_presentendend@@ -30,7 +30,7 @@ describe Admin::ColorSchemesController doit "returns JSON" dopost :create, params: valid_params, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)expect(::JSON.parse(response.body)['id']).to be_presentend@@ -51,7 +51,7 @@ describe Admin::ColorSchemesController doit "returns success" doColorSchemeRevisor.expects(:revise).returns(existing)put :update, params: valid_params.merge(id: existing.id), format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)endit "returns JSON" do@@ -78,7 +78,7 @@ describe Admin::ColorSchemesController doexpect {delete :destroy, params: { id: existing.id }, format: :json}.to change { ColorScheme.count }.by(-1)- expect(response).to be_successful+ expect(response.status).to eq(200)endendenddiff --git a/spec/controllers/admin/dashboard_controller_spec.rb b/spec/controllers/admin/dashboard_controller_spec.rbindex cfde3a4ef5f..f10397a345d 100644--- a/spec/controllers/admin/dashboard_controller_spec.rb+++ b/spec/controllers/admin/dashboard_controller_spec.rb@@ -23,7 +23,7 @@ describe Admin::DashboardController doit 'returns discourse version info' doget :index, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)['version_check']).to be_presentendend@@ -50,7 +50,7 @@ describe Admin::DashboardController doit 'returns an empty array' doget :problems, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json['problems'].size).to eq(0)enddiff --git a/spec/controllers/admin/email_controller_spec.rb b/spec/controllers/admin/email_controller_spec.rbindex 7f881f974ff..a8f838f64dc 100644--- a/spec/controllers/admin/email_controller_spec.rb+++ b/spec/controllers/admin/email_controller_spec.rb@@ -76,7 +76,7 @@ describe Admin::EmailController dolast_seen_at: 1.week.ago, username: user.username}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)endenddiff --git a/spec/controllers/admin/emojis_controller_spec.rb b/spec/controllers/admin/emojis_controller_spec.rbindex 7a1f3618c62..5faafdfeb34 100644--- a/spec/controllers/admin/emojis_controller_spec.rb+++ b/spec/controllers/admin/emojis_controller_spec.rb@@ -23,7 +23,7 @@ describe Admin::EmojisController doit "returns a list of custom emojis" doEmoji.expects(:custom).returns([custom_emoji])get :index, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json[0]["name"]).to eq(custom_emoji.name)expect(json[0]["url"]).to eq(custom_emoji.url)diff --git a/spec/controllers/admin/impersonate_controller_spec.rb b/spec/controllers/admin/impersonate_controller_spec.rbindex b9793cc80c2..2a43778f632 100644--- a/spec/controllers/admin/impersonate_controller_spec.rb+++ b/spec/controllers/admin/impersonate_controller_spec.rb@@ -13,7 +13,7 @@ describe Admin::ImpersonateController docontext 'index' doit 'returns success' doget :index, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -48,7 +48,7 @@ describe Admin::ImpersonateController doit "returns success" dopost :create, params: { username_or_email: user.email }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)endit "also works with an email address" dodiff --git a/spec/controllers/admin/permalinks_controller_spec.rb b/spec/controllers/admin/permalinks_controller_spec.rbindex 3befb17ff5c..1084eed2103 100644--- a/spec/controllers/admin/permalinks_controller_spec.rb+++ b/spec/controllers/admin/permalinks_controller_spec.rb@@ -17,7 +17,7 @@ describe Admin::PermalinksController doget :index, params: { filter: "topic" }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)result = JSON.parse(response.body)expect(result.length).to eq(2)end@@ -30,7 +30,7 @@ describe Admin::PermalinksController doget :index, params: { filter: "discourse" }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)result = JSON.parse(response.body)expect(result.length).to eq(2)end@@ -43,7 +43,7 @@ describe Admin::PermalinksController doget :index, params: { filter: "discourse" }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)result = JSON.parse(response.body)expect(result.length).to eq(3)enddiff --git a/spec/controllers/admin/plugins_controller_spec.rb b/spec/controllers/admin/plugins_controller_spec.rbindex 7e599c55337..a1907c23748 100644--- a/spec/controllers/admin/plugins_controller_spec.rb+++ b/spec/controllers/admin/plugins_controller_spec.rb@@ -11,7 +11,7 @@ describe Admin::PluginsController doit 'should return JSON' doget :index, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)expect(::JSON.parse(response.body).has_key?('plugins')).to eq(true)endenddiff --git a/spec/controllers/admin/reports_controller_spec.rb b/spec/controllers/admin/reports_controller_spec.rbindex 021576405ed..d440b941026 100644--- a/spec/controllers/admin/reports_controller_spec.rb+++ b/spec/controllers/admin/reports_controller_spec.rb@@ -45,7 +45,7 @@ describe Admin::ReportsController doendit "renders the report as JSON" do- expect(response).to be_successful+ expect(response.status).to eq(200)endit "renders the report as JSON" do@@ -67,7 +67,7 @@ describe Admin::ReportsController doget :show, params: { type: 'topics', category_id: category.id }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)report = JSON.parse(response.body)["report"]@@ -87,7 +87,7 @@ describe Admin::ReportsController doget :show, params: { type: 'signups', group_id: group.id }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)report = JSON.parse(response.body)["report"]diff --git a/spec/controllers/admin/screened_ip_addresses_controller_spec.rb b/spec/controllers/admin/screened_ip_addresses_controller_spec.rbindex 4176173d3be..fb4ed1e9bb5 100644--- a/spec/controllers/admin/screened_ip_addresses_controller_spec.rb+++ b/spec/controllers/admin/screened_ip_addresses_controller_spec.rb@@ -18,13 +18,13 @@ describe Admin::ScreenedIpAddressesController doget :index, params: { filter: "1.2.*" }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)result = JSON.parse(response.body)expect(result.length).to eq(3)get :index, params: { filter: "4.5.6.7" }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)result = JSON.parse(response.body)expect(result.length).to eq(1)end@@ -45,7 +45,7 @@ describe Admin::ScreenedIpAddressesController doSiteSetting.min_ban_entries_for_roll_up = 3post :roll_up, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)subnet = ScreenedIpAddress.where(ip_address: "1.2.3.0/24").firstexpect(subnet).to be_present@@ -65,7 +65,7 @@ describe Admin::ScreenedIpAddressesController doSiteSetting.min_ban_entries_for_roll_up = 5post :roll_up, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)subnet = ScreenedIpAddress.where(ip_address: "1.2.0.0/16").firstexpect(subnet).to be_presentdiff --git a/spec/controllers/admin/site_texts_controller_spec.rb b/spec/controllers/admin/site_texts_controller_spec.rbindex 6acb89da03c..d9bce364879 100644--- a/spec/controllers/admin/site_texts_controller_spec.rb+++ b/spec/controllers/admin/site_texts_controller_spec.rb@@ -14,7 +14,7 @@ describe Admin::SiteTextsController docontext '.index' doit 'returns json' doget :index, params: { q: 'title' }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)expect(::JSON.parse(response.body)).to be_presentendend@@ -22,7 +22,7 @@ describe Admin::SiteTextsController docontext '.show' doit 'returns a site text for a key that exists' doget :show, params: { id: 'title' }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json).to be_present@@ -71,7 +71,7 @@ describe Admin::SiteTextsController doorig_title = I18n.t(:title)put :update, params: { id: 'title', site_text: { value: 'hello' } }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json).to be_present@@ -84,7 +84,7 @@ describe Admin::SiteTextsController do# Revertput :revert, params: { id: 'title' }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json).to be_presentdiff --git a/spec/controllers/admin/staff_action_logs_controller_spec.rb b/spec/controllers/admin/staff_action_logs_controller_spec.rbindex 5f12839e38e..0950429f62e 100644--- a/spec/controllers/admin/staff_action_logs_controller_spec.rb+++ b/spec/controllers/admin/staff_action_logs_controller_spec.rb@@ -17,7 +17,7 @@ describe Admin::StaffActionLogsController doget :index, params: { action_id: UserHistory.actions[:delete_topic] }, format: :jsonjson = JSON.parse(response.body)- expect(response).to be_successful+ expect(response.status).to eq(200)expect(json["staff_action_logs"].length).to eq(1)expect(json["staff_action_logs"][0]["action_name"]).to eq("delete_topic")@@ -41,7 +41,7 @@ describe Admin::StaffActionLogsController do.log_theme_change(original_json, theme)get :diff, params: { id: record.id }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)parsed = JSON.parse(response.body)expect(parsed["side_by_side"]).to include("up")diff --git a/spec/controllers/admin/themes_controller_spec.rb b/spec/controllers/admin/themes_controller_spec.rbindex e129499d4cf..30625c7d570 100644--- a/spec/controllers/admin/themes_controller_spec.rb+++ b/spec/controllers/admin/themes_controller_spec.rb@@ -66,7 +66,7 @@ describe Admin::ThemesController doupload.destroypost :import, params: { theme: uploaded_json }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)temp.unlinktheme = Theme.last@@ -79,7 +79,7 @@ describe Admin::ThemesController doit 'imports a theme' dopost :import, params: { theme: theme_file }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)@@ -113,7 +113,7 @@ describe Admin::ThemesController doget :index, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)@@ -133,7 +133,7 @@ describe Admin::ThemesController do}}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)@@ -186,7 +186,7 @@ describe Admin::ThemesController do}}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)diff --git a/spec/controllers/admin/user_fields_controller_spec.rb b/spec/controllers/admin/user_fields_controller_spec.rbindex b885c8b3894..47ed6de465b 100644--- a/spec/controllers/admin/user_fields_controller_spec.rb+++ b/spec/controllers/admin/user_fields_controller_spec.rb@@ -16,7 +16,7 @@ describe Admin::UserFieldsController douser_field: { name: 'hello', description: 'hello desc', field_type: 'text' }}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)}.to change(UserField, :count).by(1)end@@ -31,7 +31,7 @@ describe Admin::UserFieldsController do}}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)end.to change(UserField, :count).by(1)expect(UserFieldOption.count).to eq(3)@@ -43,7 +43,7 @@ describe Admin::UserFieldsController doit "returns a list of user fields" doget :index, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json['user_fields']).to be_presentend@@ -55,7 +55,7 @@ describe Admin::UserFieldsController doit "deletes the user field" doexpect {delete :destroy, params: { id: user_field.id }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)}.to change(UserField, :count).by(-1)endend@@ -69,7 +69,7 @@ describe Admin::UserFieldsController douser_field: { name: 'fraggle', field_type: 'confirm', description: 'muppet' }}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)user_field.reloadexpect(user_field.name).to eq('fraggle')expect(user_field.field_type).to eq('confirm')@@ -86,7 +86,7 @@ describe Admin::UserFieldsController do}}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)user_field.reloadexpect(user_field.name).to eq('fraggle')expect(user_field.field_type).to eq('dropdown')@@ -105,7 +105,7 @@ describe Admin::UserFieldsController do}}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)user_field.reloadexpect(user_field.user_field_options.size).to eq(2)@@ -119,7 +119,7 @@ describe Admin::UserFieldsController do}}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)user_field.reloadexpect(user_field.user_field_options.size).to eq(2)enddiff --git a/spec/controllers/admin/users_controller_spec.rb b/spec/controllers/admin/users_controller_spec.rbindex d82e74e06fd..8288d07675e 100644--- a/spec/controllers/admin/users_controller_spec.rb+++ b/spec/controllers/admin/users_controller_spec.rb@@ -15,7 +15,7 @@ describe Admin::UsersController docontext '#index' doit 'returns success' doget :index, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)endit 'returns JSON' do@@ -48,7 +48,7 @@ describe Admin::UsersController docontext 'an existing user' doit 'returns success' doget :show, params: { id: @user.id }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -135,7 +135,7 @@ describe Admin::UsersController doformat: :json})- expect(response).to be_successful+ expect(response.status).to eq(200)user.reloadexpect(user).to be_suspended@@ -160,7 +160,7 @@ describe Admin::UsersController doit "can have an associated post" doput(:suspend, params: suspend_params)- expect(response).to be_successful+ expect(response.status).to eq(200)log = UserHistory.where(target_user_id: user.id).order('id desc').firstexpect(log).to be_present@@ -171,7 +171,7 @@ describe Admin::UsersController doput(:suspend, params: suspend_params.merge(post_action: 'delete'))post.reloadexpect(post.deleted_at).to be_present- expect(response).to be_successful+ expect(response.status).to eq(200)endit "can edit an associated post" do@@ -182,7 +182,7 @@ describe Admin::UsersController dopost.reloadexpect(post.deleted_at).to be_blankexpect(post.raw).to eq("this is the edited content")- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -205,7 +205,7 @@ describe Admin::UsersController doformat: :json})- expect(response).to be_successful+ expect(response.status).to eq(200)log = UserHistory.where(target_user_id: user.id).order('id desc').firstexpect(log).to be_present@@ -274,7 +274,7 @@ describe Admin::UsersController dogroup_id: group.id, user_id: user.id}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)expect(GroupUser.where(user_id: user.id, group_id: group.id).exists?).to eq(true)group_history = GroupHistory.last@@ -288,7 +288,7 @@ describe Admin::UsersController dogroup_id: group.id, user_id: user.id}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -378,7 +378,7 @@ describe Admin::UsersController do@another_user.reloadexpect(@another_user.trust_level).to eq(2)- expect(response).to be_successful+ expect(response.status).to eq(200)endit "raises no error when demoting a user below their current trust level (locks trust level)" do@@ -394,7 +394,7 @@ describe Admin::UsersController dolevel: TrustLevel[0]}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)@another_user.reloadexpect(@another_user.trust_level).to eq(TrustLevel[0])expect(@another_user.manual_locked_trust_level).to eq(TrustLevel[0])@@ -474,7 +474,7 @@ describe Admin::UsersController dousers: [reject_me.id, reject_me_too.id]}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json['success'].to_i).to eq(2)expect(json['failed'].to_i).to eq(0)@@ -493,7 +493,7 @@ describe Admin::UsersController dousers: [reject_me.id, reject_me_too.id]}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json['success'].to_i).to eq(1)expect(json['failed'].to_i).to eq(1)@@ -506,7 +506,7 @@ describe Admin::UsersController dousers: [reject_me.id]}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json['success'].to_i).to eq(0)expect(json['failed'].to_i).to eq(1)@@ -538,7 +538,7 @@ describe Admin::UsersController doit "doesn't return an error if delete_posts == true" dodelete :destroy, params: { id: delete_me.id, delete_posts: true }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -555,7 +555,7 @@ describe Admin::UsersController doit "returns success" doput :activate, params: { user_id: @reg_user.id }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json['success']).to eq("OK")end@@ -567,7 +567,7 @@ describe Admin::UsersController doexpect(@reg_user.email_confirmed?).to eq(false)put :activate, params: { user_id: @reg_user.id }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)@reg_user.reloadexpect(@reg_user.email_confirmed?).to eq(true)@@ -581,7 +581,7 @@ describe Admin::UsersController doit "returns success" doput :log_out, params: { user_id: @reg_user.id }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json['success']).to eq("OK")end@@ -612,7 +612,7 @@ describe Admin::UsersController doit "punishes the user for spamming" doput :silence, params: { user_id: @reg_user.id }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)@reg_user.reloadexpect(@reg_user).to be_silencedend@@ -626,7 +626,7 @@ describe Admin::UsersController dopost_action: 'edit',post_edit: "this is the new contents for the post"}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)silence_post.reloadexpect(silence_post.raw).to eq("this is the new contents for the post")@@ -742,7 +742,7 @@ describe Admin::UsersController doname: 'Bill', username: 'bill22', email: '[email protected]'}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)u = User.find_by_email('[email protected]')expect(u.name).to eq("Bill")@@ -758,7 +758,7 @@ describe Admin::UsersController doname: 'Bill', username: 'bill22', email: '[email protected]', send_email: '0'}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["password_url"]).to be_presentend@@ -806,7 +806,7 @@ describe Admin::UsersController dosso.email = "[email protected]"post :sync_sso, params: Rack::Utils.parse_query(sso.payload), format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)user.reloadexpect(user.email).to eq("[email protected]")@@ -820,7 +820,7 @@ describe Admin::UsersController dosso.email = "[email protected]"sso.external_id = "2"post :sync_sso, params: Rack::Utils.parse_query(sso.payload), format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)user = User.find_by_email('[email protected]')expect(user).to be_presentdiff --git a/spec/controllers/admin/web_hooks_controller_spec.rb b/spec/controllers/admin/web_hooks_controller_spec.rbindex 1d87cb43ce1..3cd84de6e9b 100644--- a/spec/controllers/admin/web_hooks_controller_spec.rb+++ b/spec/controllers/admin/web_hooks_controller_spec.rb@@ -28,7 +28,7 @@ describe Admin::WebHooksController do}}, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["web_hook"]["payload_url"]).to be_present@@ -62,7 +62,7 @@ describe Admin::WebHooksController dopost :ping, params: { id: web_hook.id }, format: :json- expect(response).to be_successful+ expect(response.status).to eq(200)endendenddiff --git a/spec/requests/about_controller_spec.rb b/spec/requests/about_controller_spec.rbindex ec4e07d4bc9..cf7ab39d5eb 100644--- a/spec/requests/about_controller_spec.rb+++ b/spec/requests/about_controller_spec.rb@@ -8,7 +8,7 @@ describe AboutController doSiteSetting.login_required = falseget "/about"- expect(response).to be_successful+ expect(response.status).to eq(200)endit 'should redirect to login page for anonymous user when login_required is true' do@@ -23,7 +23,7 @@ describe AboutController dosign_in(Fabricate(:user))get "/about"- expect(response).to be_successful+ expect(response.status).to eq(200)endendenddiff --git a/spec/requests/admin/backups_controller_spec.rb b/spec/requests/admin/backups_controller_spec.rbindex d4be1f1674a..e83e149c590 100644--- a/spec/requests/admin/backups_controller_spec.rb+++ b/spec/requests/admin/backups_controller_spec.rb@@ -21,7 +21,7 @@ RSpec.describe Admin::BackupsController dopost "/admin/backups/rollback.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endit 'should not allow rollback via a GET request' do@@ -36,7 +36,7 @@ RSpec.describe Admin::BackupsController dodelete "/admin/backups/cancel.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endit 'should not allow cancel via a GET request' do@@ -59,7 +59,7 @@ RSpec.describe Admin::BackupsController doput "/admin/backups/#{backup_filename}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endit "returns 404 when the backup does not exist" dodiff --git a/spec/requests/admin/email_templates_controller_spec.rb b/spec/requests/admin/email_templates_controller_spec.rbindex 8957a567172..b37a5e65a23 100644--- a/spec/requests/admin/email_templates_controller_spec.rb+++ b/spec/requests/admin/email_templates_controller_spec.rb@@ -33,7 +33,7 @@ RSpec.describe Admin::EmailTemplatesController dosign_in(admin)get '/admin/customize/email_templates.json'- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json['email_templates']).to be_present@@ -169,7 +169,7 @@ RSpec.describe Admin::EmailTemplatesController doemail_template: { subject: email_subject, body: email_body }}, headers: headers- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json).to be_present@@ -265,7 +265,7 @@ RSpec.describe Admin::EmailTemplatesController doit "returns the restored email template" dodelete '/admin/customize/email_templates/user_notifications.admin_login', headers: headers- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json).to be_presentdiff --git a/spec/requests/admin/flagged_topics_controller_spec.rb b/spec/requests/admin/flagged_topics_controller_spec.rbindex 87dfde84e38..3d27ac33af6 100644--- a/spec/requests/admin/flagged_topics_controller_spec.rb+++ b/spec/requests/admin/flagged_topics_controller_spec.rb@@ -6,7 +6,7 @@ RSpec.describe Admin::FlaggedTopicsController doshared_examples "successfully retrieve list of flagged topics" doit "returns a list of flagged topics" doget "/admin/flagged_topics.json"- expect(response).to be_successful+ expect(response.status).to eq(200)data = ::JSON.parse(response.body)expect(data['flagged_topics']).to be_presentdiff --git a/spec/requests/admin/flags_controller_spec.rb b/spec/requests/admin/flags_controller_spec.rbindex 1d711d590ba..c8ebc0ea779 100644--- a/spec/requests/admin/flags_controller_spec.rb+++ b/spec/requests/admin/flags_controller_spec.rb@@ -13,7 +13,7 @@ RSpec.describe Admin::FlagsController doit 'should return the right response when nothing is flagged' doget '/admin/flags.json'- expect(response).to be_successful+ expect(response.status).to eq(200)data = ::JSON.parse(response.body)expect(data["users"]).to eq([])@@ -25,7 +25,7 @@ RSpec.describe Admin::FlagsController doget '/admin/flags.json'- expect(response).to be_successful+ expect(response.status).to eq(200)data = ::JSON.parse(response.body)expect(data["users"].length).to eq(2)diff --git a/spec/requests/admin/moderation_history_controller_spec.rb b/spec/requests/admin/moderation_history_controller_spec.rbindex 1b73f386688..b35989ad307 100644--- a/spec/requests/admin/moderation_history_controller_spec.rb+++ b/spec/requests/admin/moderation_history_controller_spec.rb@@ -22,7 +22,7 @@ RSpec.describe Admin::BackupsController dodescribe "for a post" doit "returns an empty array when the post doesn't exist" doget "/admin/moderation_history.json?filter=post&post_id=99999999"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(::JSON.parse(response.body)['moderation_history']).to be_blankend@@ -31,7 +31,7 @@ RSpec.describe Admin::BackupsController dop = Fabricate(:post, topic: p.topic)PostDestroyer.new(Discourse.system_user, p).destroyget "/admin/moderation_history.json?filter=post&post_id=#{p.id}"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(::JSON.parse(response.body)['moderation_history']).to be_presentend@@ -40,7 +40,7 @@ RSpec.describe Admin::BackupsController dodescribe "for a topic" doit "returns empty history when the topic doesn't exist" doget "/admin/moderation_history.json?filter=topic&topic_id=1234"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(::JSON.parse(response.body)['moderation_history']).to be_blankend@@ -48,7 +48,7 @@ RSpec.describe Admin::BackupsController dop = Fabricate(:post)PostDestroyer.new(Discourse.system_user, p).destroyget "/admin/moderation_history.json?filter=topic&topic_id=#{p.topic_id}"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(::JSON.parse(response.body)['moderation_history']).to be_presentendenddiff --git a/spec/requests/admin/search_logs_spec.rb b/spec/requests/admin/search_logs_spec.rbindex f872fb87001..b234ea2abff 100644--- a/spec/requests/admin/search_logs_spec.rb+++ b/spec/requests/admin/search_logs_spec.rb@@ -28,7 +28,7 @@ RSpec.describe Admin::SearchLogsController dosign_in(admin)get '/admin/logs/search_logs.json'- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json[0]['term']).to eq('ruby')@@ -51,7 +51,7 @@ RSpec.describe Admin::SearchLogsController dosign_in(admin)get '/admin/logs/search_logs/term/ruby.json'- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json['term']['type']).to eq('search_log_term')diff --git a/spec/requests/categories_controller_spec.rb b/spec/requests/categories_controller_spec.rbindex be6039564bf..e3a76cacbf8 100644--- a/spec/requests/categories_controller_spec.rb+++ b/spec/requests/categories_controller_spec.rb@@ -136,7 +136,7 @@ describe CategoriesController doexpect dodelete "/categories/#{category.slug}.json"end.to change(Category, :count).by(-1)- expect(response).to be_successful+ expect(response.status).to eq(200)expect(UserHistory.count).to eq(1)endend@@ -321,14 +321,14 @@ describe CategoriesController doit 'accepts valid custom slug' doput "/category/#{category.id}/slug.json", params: { slug: 'valid-slug' }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(category.reload.slug).to eq('valid-slug')endit 'accepts not well formed custom slug' doput "/category/#{category.id}/slug.json", params: { slug: ' valid slug' }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(category.reload.slug).to eq('valid-slug')end@@ -336,7 +336,7 @@ describe CategoriesController doSiteSetting.slug_generation_method = 'none'put "/category/#{category.id}/slug.json", params: { slug: ' another !_ slug @' }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(category.reload.slug).to eq('another-slug')SiteSetting.slug_generation_method = 'ascii'enddiff --git a/spec/requests/directory_items_controller_spec.rb b/spec/requests/directory_items_controller_spec.rbindex f9b0e08b888..8a188db1071 100644--- a/spec/requests/directory_items_controller_spec.rb+++ b/spec/requests/directory_items_controller_spec.rb@@ -24,7 +24,7 @@ describe DirectoryItemsController doit "succeeds" doget '/directory_items.json', params: { period: 'all' }- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -37,7 +37,7 @@ describe DirectoryItemsController doit "succeeds with a valid value" doget '/directory_items.json', params: { period: 'all' }- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json).to be_present@@ -58,7 +58,7 @@ describe DirectoryItemsController doit "finds user by name" doget '/directory_items.json', params: { period: 'all', name: 'eviltrout' }- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json).to be_present@@ -69,7 +69,7 @@ describe DirectoryItemsController doit "finds staged user by name" doget '/directory_items.json', params: { period: 'all', name: 'stage_user' }- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json).to be_present@@ -80,7 +80,7 @@ describe DirectoryItemsController doit "excludes users by username" doget '/directory_items.json', params: { period: 'all', exclude_usernames: "stage_user,eviltrout" }- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json).to be_present@@ -92,7 +92,7 @@ describe DirectoryItemsController doit "filters users by group" doget '/directory_items.json', params: { period: 'all', group: group.name }- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json).to be_presentdiff --git a/spec/requests/email_controller_spec.rb b/spec/requests/email_controller_spec.rbindex 062c24461a0..3b6a1a8f308 100644--- a/spec/requests/email_controller_spec.rb+++ b/spec/requests/email_controller_spec.rb@@ -145,7 +145,7 @@ RSpec.describe EmailController dokey = SecureRandom.hex$redis.set(key, user.email)get '/email/unsubscribed', params: { key: key, topic_id: topic.id }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to include(topic.title)endend@@ -155,7 +155,7 @@ RSpec.describe EmailController dokey = SecureRandom.hex$redis.set(key, user.email)get '/email/unsubscribed', params: { key: key, topic_id: private_topic.id }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to_not include(private_topic.title)endenddiff --git a/spec/requests/embed_controller_spec.rb b/spec/requests/embed_controller_spec.rbindex c62222a8cc7..f6cb42e88cf 100644--- a/spec/requests/embed_controller_spec.rb+++ b/spec/requests/embed_controller_spec.rb@@ -27,7 +27,7 @@ describe EmbedController doit "allows a topic to be embedded by id" dotopic = Fabricate(:topic)get '/embed/comments', params: { topic_id: topic.id }, headers: headers- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -85,7 +85,7 @@ describe EmbedController doendafter do- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.headers['X-Frame-Options']).to eq("ALLOWALL")end@@ -139,7 +139,7 @@ describe EmbedController doparams: { embed_url: embed_url },headers: { 'REFERER' => "http://eviltrout.com/wat/1-2-3.html" }- expect(response).to be_successful+ expect(response.status).to eq(200)endit "works with the second host" do@@ -147,7 +147,7 @@ describe EmbedController doparams: { embed_url: embed_url },headers: { 'REFERER' => "http://eviltrout.com/wat/1-2-3.html" }- expect(response).to be_successful+ expect(response.status).to eq(200)endit "works with a host with a path" do@@ -155,7 +155,7 @@ describe EmbedController doparams: { embed_url: embed_url },headers: { 'REFERER' => "https://example.com/some-other-path" }- expect(response).to be_successful+ expect(response.status).to eq(200)endit "contains custom class name" dodiff --git a/spec/requests/export_csv_controller_spec.rb b/spec/requests/export_csv_controller_spec.rbindex cc84bd0403a..1fe2a15e7c5 100644--- a/spec/requests/export_csv_controller_spec.rb+++ b/spec/requests/export_csv_controller_spec.rb@@ -10,7 +10,7 @@ describe ExportCsvController dodescribe ".export_entity" doit "enqueues export job" dopost "/export_csv/export_entity.json", params: { entity: "user_archive" }- expect(response).to be_success+ expect(response.status).to eq(200)expect(Jobs::ExportCsvFile.jobs.size).to eq(1)job_data = Jobs::ExportCsvFile.jobs.first["args"].first@@ -40,7 +40,7 @@ describe ExportCsvController dodescribe ".export_entity" doit "enqueues export job" dopost "/export_csv/export_entity.json", params: { entity: "staff_action" }- expect(response).to be_success+ expect(response.status).to eq(200)expect(Jobs::ExportCsvFile.jobs.size).to eq(1)job_data = Jobs::ExportCsvFile.jobs.first["args"].first@@ -51,7 +51,7 @@ describe ExportCsvController doit "should not rate limit export for staff" doUserExport.create(file_name: "screened-email-150116-010145", user_id: admin.id)post "/export_csv/export_entity.json", params: { entity: "staff_action" }- expect(response).to be_success+ expect(response.status).to eq(200)expect(Jobs::ExportCsvFile.jobs.size).to eq(1)job_data = Jobs::ExportCsvFile.jobs.first["args"].firstdiff --git a/spec/requests/extra_locales_controller_spec.rb b/spec/requests/extra_locales_controller_spec.rbindex 3093d9f38fe..a190489f4f5 100644--- a/spec/requests/extra_locales_controller_spec.rb+++ b/spec/requests/extra_locales_controller_spec.rb@@ -42,7 +42,7 @@ describe ExtraLocalesController doget "/extra-locales/admin"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body.include?("github_badges")).to eq(true)endenddiff --git a/spec/requests/groups_controller_spec.rb b/spec/requests/groups_controller_spec.rbindex 7e2b69fc776..cae3ae4c7f1 100644--- a/spec/requests/groups_controller_spec.rb+++ b/spec/requests/groups_controller_spec.rb@@ -152,7 +152,7 @@ describe GroupsController dostaff_groupget "/groups.json"- expect(response).to be_successful+ expect(response.status).to eq(200)response_body = JSON.parse(response.body)@@ -382,7 +382,7 @@ describe GroupsController dosign_in(user)get "/groups/#{group.name}/mentionable.json"- expect(response).to be_successful+ expect(response.status).to eq(200)response_body = JSON.parse(response.body)expect(response_body["mentionable"]).to eq(false)@@ -393,7 +393,7 @@ describe GroupsController do)get "/groups/#{group.name}/mentionable.json"- expect(response).to be_successful+ expect(response.status).to eq(200)response_body = JSON.parse(response.body)expect(response_body["mentionable"]).to eq(true)@@ -405,7 +405,7 @@ describe GroupsController dosign_in(user)get "/groups/#{group.name}/messageable.json"- expect(response).to be_successful+ expect(response.status).to eq(200)response_body = JSON.parse(response.body)expect(response_body["messageable"]).to eq(false)@@ -416,7 +416,7 @@ describe GroupsController do)get "/groups/#{group.name}/messageable.json"- expect(response).to be_successful+ expect(response.status).to eq(200)response_body = JSON.parse(response.body)expect(response_body["messageable"]).to eq(true)@@ -645,7 +645,7 @@ describe GroupsController doorder: 'last_seen_at', desc: true}- expect(response).to be_successful+ expect(response.status).to eq(200)members = JSON.parse(response.body)["members"]@@ -653,7 +653,7 @@ describe GroupsController doget "/groups/#{group.name}/members.json", params: { order: 'last_seen_at' }- expect(response).to be_successful+ expect(response.status).to eq(200)members = JSON.parse(response.body)["members"]@@ -663,7 +663,7 @@ describe GroupsController doorder: 'last_posted_at', desc: true}- expect(response).to be_successful+ expect(response.status).to eq(200)members = JSON.parse(response.body)["members"]@@ -673,7 +673,7 @@ describe GroupsController doit "should not allow members to be sorted by columns that are not allowed" doget "/groups/#{group.name}/members.json", params: { order: 'email' }- expect(response).to be_successful+ expect(response.status).to eq(200)members = JSON.parse(response.body)["members"]@@ -808,7 +808,7 @@ describe GroupsController doput "/groups/#{group.id}/members.json", params: { usernames: user2.username }end.to change { group.users.count }.by(1)- expect(response).to be_successful+ expect(response.status).to eq(200)group_history = GroupHistory.last@@ -834,7 +834,7 @@ describe GroupsController doparams: { usernames: [user1.username, user2.username].join(",") }end.to change { group.users.count }.by(2)- expect(response).to be_successful+ expect(response.status).to eq(200)endit "adds by id" do@@ -843,7 +843,7 @@ describe GroupsController doparams: { user_ids: [user1.id, user2.id].join(",") }end.to change { group.users.count }.by(2)- expect(response).to be_successful+ expect(response.status).to eq(200)endit "adds by email" do@@ -852,7 +852,7 @@ describe GroupsController doparams: { user_emails: [user1.email, user2.email].join(",") }end.to change { group.users.count }.by(2)- expect(response).to be_successful+ expect(response.status).to eq(200)endit 'fails when multiple member already exists' do@@ -920,7 +920,7 @@ describe GroupsController doparams: { usernames: other_user.username }end.to change { group.users.count }.by(1)- expect(response).to be_successful+ expect(response.status).to eq(200)group_history = GroupHistory.last@@ -938,7 +938,7 @@ describe GroupsController doparams: { usernames: other_user.username }end.to change { group.users.count }.by(1)- expect(response).to be_successful+ expect(response.status).to eq(200)endit 'should not allow an underprivilege user to add another user to a group' do@@ -971,7 +971,7 @@ describe GroupsController dodelete "/groups/#{group.id}/members.json", params: { user_id: user.id }end.to change { group.users.count }.by(-1)- expect(response).to be_successful+ expect(response.status).to eq(200)endit "removes by username" do@@ -979,7 +979,7 @@ describe GroupsController dodelete "/groups/#{group.id}/members.json", params: { username: user.username }end.to change { group.users.count }.by(-1)- expect(response).to be_successful+ expect(response.status).to eq(200)endit "removes user.primary_group_id when user is removed from group" do@@ -996,7 +996,7 @@ describe GroupsController doparams: { user_email: user.email }end.to change { group.users.count }.by(-1)- expect(response).to be_successful+ expect(response.status).to eq(200)endcontext 'public group' do@@ -1010,7 +1010,7 @@ describe GroupsController doparams: { username: other_user.username }end.to change { group.users.count }.by(-1)- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -1022,7 +1022,7 @@ describe GroupsController doparams: { username: other_user.username }end.to change { group.users.count }.by(-1)- expect(response).to be_successful+ expect(response.status).to eq(200)endit 'should not allow a underprivilege user to leave a group for another user' do@@ -1077,7 +1077,7 @@ describe GroupsController doit 'should allow group owner to view history' doget "/groups/#{group.name}/logs.json"- expect(response).to be_successful+ expect(response.status).to eq(200)result = JSON.parse(response.body)["logs"].last@@ -1109,7 +1109,7 @@ describe GroupsController doget "/groups/#{group.name}/logs.json"- expect(response).to be_successful+ expect(response.status).to eq(200)result = JSON.parse(response.body)["logs"].first@@ -1132,7 +1132,7 @@ describe GroupsController dofilters: { "action" => "add_user_to_group" }}- expect(response).to be_successful+ expect(response.status).to eq(200)logs = JSON.parse(response.body)["logs"]@@ -1167,7 +1167,7 @@ describe GroupsController dopost "/groups/#{group.name}/request_membership.json",params: { reason: 'Please add me in' }- expect(response).to be_successful+ expect(response.status).to eq(200)post = Post.lasttopic = post.topic@@ -1217,7 +1217,7 @@ describe GroupsController doget '/groups/search.json'- expect(response).to be_successful+ expect(response.status).to eq(200)groups = JSON.parse(response.body)expected_ids = Group::AUTO_GROUPS.map { |name, id| id }@@ -1229,7 +1229,7 @@ describe GroupsController do['GO', 'nerys'].each do |term|get "/groups/search.json?term=#{term}"- expect(response).to be_successful+ expect(response.status).to eq(200)groups = JSON.parse(response.body)expect(groups.length).to eq(1)@@ -1238,7 +1238,7 @@ describe GroupsController doget "/groups/search.json?term=KingOfTheNorth"- expect(response).to be_successful+ expect(response.status).to eq(200)groups = JSON.parse(response.body)expect(groups).to eq([])@@ -1255,7 +1255,7 @@ describe GroupsController doget "/groups/search.json?term=north"- expect(response).to be_successful+ expect(response.status).to eq(200)groups = JSON.parse(response.body)expect(groups.length).to eq(1)@@ -1269,7 +1269,7 @@ describe GroupsController doget '/groups/search.json?ignore_automatic=true'- expect(response).to be_successful+ expect(response.status).to eq(200)groups = JSON.parse(response.body)expect(groups.length).to eq(2)diff --git a/spec/requests/invites_controller_spec.rb b/spec/requests/invites_controller_spec.rbindex b945453b712..4b4586ce134 100644--- a/spec/requests/invites_controller_spec.rb+++ b/spec/requests/invites_controller_spec.rb@@ -8,7 +8,7 @@ describe InvitesController doit "returns error if invite not found" doget "/invites/nopeNOPEnope"- expect(response).to be_successful+ expect(response.status).to eq(200)body = response.bodyexpect(body).to_not have_tag(:script, with: { src: '/assets/application.js' })@@ -18,7 +18,7 @@ describe InvitesController doit "renders the accept invite page if invite exists" doget "/invites/#{invite.invite_key}"- expect(response).to be_successful+ expect(response.status).to eq(200)body = response.bodyexpect(body).to have_tag(:script, with: { src: '/assets/application.js' })@@ -29,7 +29,7 @@ describe InvitesController doinvite.update_attributes!(redeemed_at: 1.day.ago)get "/invites/#{invite.invite_key}"- expect(response).to be_successful+ expect(response.status).to eq(200)body = response.bodyexpect(body).to_not have_tag(:script, with: { src: '/assets/application.js' })@@ -100,7 +100,7 @@ describe InvitesController dogroup = Fabricate(:group)sign_in(Fabricate(:admin))post "/invites.json", params: { email: email, group_names: group.name }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(Invite.find_by(email: email).invited_groups.count).to eq(1)end@@ -112,7 +112,7 @@ describe InvitesController dopost "/invites.json", params: { email: email, group_names: group.name }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(Invite.find_by(email: email).invited_groups.count).to eq(1)end@@ -120,7 +120,7 @@ describe InvitesController douser = sign_in(Fabricate(:admin))invite = Invite.invite_by_email("[email protected]", user)post "/invites.json", params: { email: invite.email }- expect(response).to be_successful+ expect(response.status).to eq(200)endit "responds with error message in case of validation failure" do@@ -182,7 +182,7 @@ describe InvitesController doemail: email, group_names: group.name}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(Invite.find_by(email: email).invited_groups.count).to eq(1)end@@ -195,7 +195,7 @@ describe InvitesController doemail: email, group_names: "security,support"}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(Invite.find_by(email: email).invited_groups.count).to eq(2)endend@@ -205,7 +205,7 @@ describe InvitesController docontext 'with an invalid invite id' doit "redirects to the root and doesn't change the session" doput "/invites/show/doesntexist.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["success"]).to eq(false)expect(json["message"]).to eq(I18n.t('invite.not_found'))@@ -223,7 +223,7 @@ describe InvitesController doit "redirects to the root" doput "/invites/show/#{invite.invite_key}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["success"]).to eq(false)expect(json["message"]).to eq(I18n.t('invite.not_found'))@@ -254,7 +254,7 @@ describe InvitesController do:user_logged_in, :user_first_logged_in)invite.reload- expect(response).to be_successful+ expect(response.status).to eq(200)expect(session[:current_user_id]).to eq(invite.user_id)expect(invite.redeemed?).to be_truthyend@@ -271,7 +271,7 @@ describe InvitesController docontext 'failure' doit "doesn't log in the user if there's a validation error" doput "/invites/show/#{invite.invite_key}.json", params: { password: "password" }- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["success"]).to eq(false)expect(json["errors"]["password"]).to be_present@@ -286,13 +286,13 @@ describe InvitesController doit 'sends a welcome message if set' douser.send_welcome_message = trueput "/invites/show/#{invite.invite_key}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(Jobs::SendSystemMessage.jobs.size).to eq(1)endit "sends password reset email if password is not set" doput "/invites/show/#{invite.invite_key}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(Jobs::InvitePasswordInstructionsEmail.jobs.size).to eq(1)end@@ -300,20 +300,20 @@ describe InvitesController doSiteSetting.sso_url = "https://www.example.com/sso"SiteSetting.enable_sso = trueput "/invites/show/#{invite.invite_key}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(Jobs::InvitePasswordInstructionsEmail.jobs.size).to eq(0)endit "does not send password reset email if local login is disabled" doSiteSetting.enable_local_logins = falseput "/invites/show/#{invite.invite_key}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(Jobs::InvitePasswordInstructionsEmail.jobs.size).to eq(0)endit 'sends an activation email if password is set' doput "/invites/show/#{invite.invite_key}.json", params: { password: "verystrongpassword" }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(Jobs::InvitePasswordInstructionsEmail.jobs.size).to eq(0)expect(Jobs::CriticalUserEmail.jobs.size).to eq(1)end@@ -381,7 +381,7 @@ describe InvitesController doit "resends the invite" doSiteSetting.queue_jobs = truepost "/invites/reinvite.json", params: { email: invite.email }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(Jobs::InviteEmail.jobs.size).to eq(1)endend@@ -412,7 +412,7 @@ describe InvitesController doSiteSetting.queue_jobs = truesign_in(Fabricate(:admin))post "/invites/upload_csv.json", params: { file: file, name: filename }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(Jobs::BulkInvite.jobs.size).to eq(1)endenddiff --git a/spec/requests/list_controller_spec.rb b/spec/requests/list_controller_spec.rbindex f7bb4286cfc..0f72cedfa03 100644--- a/spec/requests/list_controller_spec.rb+++ b/spec/requests/list_controller_spec.rb@@ -13,19 +13,19 @@ RSpec.describe ListController dodescribe '#index' doit "doesn't throw an error with a negative page" doget "/#{Discourse.anonymous_filters[1]}", params: { page: -1024 }- expect(response).to be_successful+ expect(response.status).to eq(200)endit "doesn't throw an error with page params as an array" doget "/#{Discourse.anonymous_filters[1]}", params: { page: ['7'] }- expect(response).to be_successful+ expect(response.status).to eq(200)end(Discourse.anonymous_filters - [:categories]).each do |filter|context "#{filter}" doit "succeeds" doget "/#{filter}"- expect(response).to be_successful+ expect(response.status).to eq(200)endendend@@ -34,7 +34,7 @@ RSpec.describe ListController dop = create_postget "/latest.json", params: { topic_ids: "#{p.topic_id}" }- expect(response).to be_successful+ expect(response.status).to eq(200)parsed = JSON.parse(response.body)expect(parsed["topic_list"]["topics"].length).to eq(1)end@@ -238,20 +238,20 @@ RSpec.describe ListController dodescribe 'RSS feeds' doit 'renders latest RSS' doget "/latest.rss"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.content_type).to eq('application/rss+xml')endit 'renders top RSS' doget "/top.rss"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.content_type).to eq('application/rss+xml')endTopTopic.periods.each do |period|it "renders #{period} top RSS" doget "/top/#{period}.rss"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.content_type).to eq('application/rss+xml')endend@@ -312,7 +312,7 @@ RSpec.describe ListController doit 'uses the correct category' doget "/c/#{other_category.slug}/l/latest.json"- expect(response).to be_successful+ expect(response.status).to eq(200)body = JSON.parse(response.body)expect(body["topic_list"]["topics"].first["category_id"]).to eq(other_category.id)@@ -340,7 +340,7 @@ RSpec.describe ListController dodescribe 'feed' doit 'renders RSS' doget "/c/#{category.slug}.rss"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.content_type).to eq('application/rss+xml')endend@@ -349,7 +349,7 @@ RSpec.describe ListController doit "has a top default view" docategory.update_attributes!(default_view: 'top', default_top_period: 'monthly')get "/c/#{category.slug}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["topic_list"]["for_period"]).to eq("monthly")end@@ -357,7 +357,7 @@ RSpec.describe ListController doit "has a default view of nil" docategory.update_attributes!(default_view: nil)get "/c/#{category.slug}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["topic_list"]["for_period"]).to be_blankend@@ -365,7 +365,7 @@ RSpec.describe ListController doit "has a default view of ''" docategory.update_attributes!(default_view: '')get "/c/#{category.slug}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["topic_list"]["for_period"]).to be_blankend@@ -373,7 +373,7 @@ RSpec.describe ListController doit "has a default view of latest" docategory.update_attributes!(default_view: 'latest')get "/c/#{category.slug}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["topic_list"]["for_period"]).to be_blankend@@ -382,13 +382,13 @@ RSpec.describe ListController dodescribe "renders canonical tag" doit 'for category default view' doget "/c/#{category.slug}"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(css_select("link[rel=canonical]").length).to eq(1)endit 'for category latest view' doget "/c/#{category.slug}/l/latest"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(css_select("link[rel=canonical]").length).to eq(1)endend@@ -403,7 +403,7 @@ RSpec.describe ListController doit "should respond with a list" doget "/topics/created-by/#{user.username}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["topic_list"]["topics"].size).to eq(1)end@@ -421,7 +421,7 @@ RSpec.describe ListController dopm.topic_allowed_users.create!(user: user)sign_in(user)get "/topics/private-messages/#{user.username}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["topic_list"]["topics"].size).to eq(1)end@@ -442,7 +442,7 @@ RSpec.describe ListController doit "succeeds when the user can see private messages" dosign_in(user)get "/topics/private-messages-sent/#{user.username}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["topic_list"]["topics"].size).to eq(1)end@@ -465,7 +465,7 @@ RSpec.describe ListController doit "succeeds when the user can see private messages" dosign_in(user)get "/topics/private-messages-unread/#{user.username}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["topic_list"]["topics"].size).to eq(1)end@@ -481,7 +481,7 @@ RSpec.describe ListController doit "succeeds" dosign_in(user)get "/read"- expect(response).to be_successful+ expect(response.status).to eq(200)endendend@@ -546,7 +546,7 @@ RSpec.describe ListController doit "suppresses categories from the latest list" doget "/#{SiteSetting.homepage}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)topic_titles = JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["title"] }expect(topic_titles).not_to include(topic_in_sub_category.title, topic_in_category_two.title)@@ -554,7 +554,7 @@ RSpec.describe ListController doit "does not suppress" doget "/#{SiteSetting.homepage}.json", params: { category: category_one.id }- expect(response).to be_successful+ expect(response.status).to eq(200)topic_titles = JSON.parse(response.body)["topic_list"]["topics"].map { |t| t["title"] }expect(topic_titles).to include(topic_in_sub_category.title)diff --git a/spec/requests/notifications_controller_spec.rb b/spec/requests/notifications_controller_spec.rbindex f7dede2aa5c..e22721f82b5 100644--- a/spec/requests/notifications_controller_spec.rb+++ b/spec/requests/notifications_controller_spec.rb@@ -36,12 +36,12 @@ describe NotificationsController dodescribe '#index' doit 'should succeed for recent' doget "/notifications", params: { recent: true }- expect(response).to be_successful+ expect(response.status).to eq(200)endit 'should succeed for history' doget "/notifications"- expect(response).to be_successful+ expect(response.status).to eq(200)endit 'should mark notifications as viewed' do@@ -72,14 +72,14 @@ describe NotificationsController doit 'should succeed' doput "/notifications/mark-read.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endit "can update a single notification" donotification = Fabricate(:notification, user: user)notification2 = Fabricate(:notification, user: user)put "/notifications/mark-read.json", params: { id: notification.id }- expect(response).to be_successful+ expect(response.status).to eq(200)notification.reloadnotification2.reloaddiff --git a/spec/requests/omniauth_callbacks_controller_spec.rb b/spec/requests/omniauth_callbacks_controller_spec.rbindex a7316c76517..c4deba0b83e 100644--- a/spec/requests/omniauth_callbacks_controller_spec.rb+++ b/spec/requests/omniauth_callbacks_controller_spec.rb@@ -80,7 +80,7 @@ RSpec.describe Users::OmniauthCallbacksController doexpect(events.map { |event| event[:event_name] }).to include(:user_logged_in, :user_first_logged_in)- expect(response).to be_successful+ expect(response.status).to eq(200)response_body = JSON.parse(response.body)@@ -106,7 +106,7 @@ RSpec.describe Users::OmniauthCallbacksController doexpect(events.map { |event| event[:event_name] }).to include(:user_logged_in, :user_first_logged_in)- expect(response).to be_successful+ expect(response.status).to eq(200)user.reloadexpect(user.email_confirmed?).to eq(true)@@ -125,7 +125,7 @@ RSpec.describe Users::OmniauthCallbacksController doexpect(events.map { |event| event[:event_name] }).to include(:user_logged_in, :user_first_logged_in)- expect(response).to be_successful+ expect(response.status).to eq(200)user.reloadexpect(user.staged).to eq(false)@@ -185,7 +185,7 @@ RSpec.describe Users::OmniauthCallbacksController doit 'should return the right response' doget "/auth/google_oauth2/callback.json"- expect(response).to be_successful+ expect(response.status).to eq(200)response_body = JSON.parse(response.body)diff --git a/spec/requests/onebox_controller_spec.rb b/spec/requests/onebox_controller_spec.rbindex 04d9da91fc1..21728df3e75 100644--- a/spec/requests/onebox_controller_spec.rb+++ b/spec/requests/onebox_controller_spec.rb@@ -56,13 +56,13 @@ describe OneboxController dobypass_limitingRails.cache.delete("onebox__#{url}")get "/onebox.json", params: { url: url }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to include("Onebox1")bypass_limitingstub_request(:get, url).to_return(status: 200, body: html2).then.to_raiseget "/onebox.json", params: { url: url, refresh: 'true' }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to include("Onebox2")end@@ -75,12 +75,12 @@ describe OneboxController doget "/onebox.json", params: { url: url, refresh: "true" }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to include('Onebox1')expect(response.body).to include('bodycontent')get "/onebox.json", params: { url: url }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to include('Onebox1')expect(response.body).to include('bodycontent')end@@ -104,7 +104,7 @@ describe OneboxController dostub_request(:get, url).to_return(body: html).then.to_raiseget "/onebox.json", params: { url: url, refresh: "true" }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to include("Onebox1")endenddiff --git a/spec/requests/post_action_users_controller_spec.rb b/spec/requests/post_action_users_controller_spec.rbindex 04d40eb866c..1fdf4bb529a 100644--- a/spec/requests/post_action_users_controller_spec.rb+++ b/spec/requests/post_action_users_controller_spec.rb@@ -53,7 +53,7 @@ describe PostActionUsersController doid: post.id, post_action_type_id: PostActionType.types[:like]}- expect(response).to be_successful+ expect(response.status).to eq(200)endit "paginates post actions" dodiff --git a/spec/requests/post_actions_controller_spec.rb b/spec/requests/post_actions_controller_spec.rbindex f3e8a385576..6be7be749ff 100644--- a/spec/requests/post_actions_controller_spec.rb+++ b/spec/requests/post_actions_controller_spec.rb@@ -37,7 +37,7 @@ RSpec.describe PostActionsController doit 'returns success' dodelete "/post_actions/#{post.id}.json", params: { post_action_type_id: PostActionType.types[:bookmark] }- expect(response).to be_success+ expect(response.status).to eq(200)endit 'deletes the action' do@@ -45,7 +45,7 @@ RSpec.describe PostActionsController dopost_action_type_id: PostActionType.types[:bookmark]}- expect(response).to be_success+ expect(response.status).to eq(200)expect(PostAction.exists?(user_id: user.id,post_id: post.id,@@ -137,7 +137,7 @@ RSpec.describe PostActionsController dopost_action = PostAction.last- expect(response).to be_success+ expect(response.status).to eq(200)expect(post_action.post_id).to eq(post_1.id)expect(post_action.post_action_type_id).to eq(PostActionType.types[:like])end@@ -165,7 +165,7 @@ RSpec.describe PostActionsController domessage: message}- expect(response).to be_success+ expect(response.status).to eq(200)expect(PostAction.last.post_id).to eq(post_1.id)expect(Post.last.raw).to include(message)end@@ -180,7 +180,7 @@ RSpec.describe PostActionsController dois_warning: true}- expect(response).to be_success+ expect(response.status).to eq(200)expect(PostAction.last.post_id).to eq(post_1.id)post = Post.last@@ -209,7 +209,7 @@ RSpec.describe PostActionsController dotake_action: 'true'}- expect(response).to be_successful+ expect(response.status).to eq(200)post_action = PostAction.last@@ -225,7 +225,7 @@ RSpec.describe PostActionsController dopost_action_type_id: PostActionType.types[:like]}- expect(response).to be_successful+ expect(response.status).to eq(200)post_action = PostAction.last@@ -282,7 +282,7 @@ RSpec.describe PostActionsController doid: flagged_post.id, post_action_type_id: PostActionType.types[:spam]}- expect(response).to be_success+ expect(response.status).to eq(200)flag.reloadexpect(flag.deferred_at).to be_presentend@@ -294,7 +294,7 @@ RSpec.describe PostActionsController doid: flagged_post.id, post_action_type_id: PostActionType.types[:spam]}- expect(response).to be_success+ expect(response.status).to eq(200)flag.reloadexpect(flag.deferred_at).to be_presentenddiff --git a/spec/requests/posts_controller_spec.rb b/spec/requests/posts_controller_spec.rbindex 74d6c3ea35f..7f6620bd05a 100644--- a/spec/requests/posts_controller_spec.rb+++ b/spec/requests/posts_controller_spec.rb@@ -14,7 +14,7 @@ shared_examples 'finding and showing post' doit 'succeeds' doget url- expect(response).to be_successful+ expect(response.status).to eq(200)endcontext "deleted post" do@@ -36,13 +36,13 @@ shared_examples 'finding and showing post' doit "can find posts as a moderator" dosign_in(Fabricate(:moderator))get url- expect(response).to be_successful+ expect(response.status).to eq(200)endit "can find posts as a admin" dosign_in(Fabricate(:admin))get url- expect(response).to be_successful+ expect(response.status).to eq(200)endendend@@ -277,7 +277,7 @@ describe PostsController doit 'passes the edit reason through' doput "/posts/#{post.id}.json", params: update_params- expect(response).to be_successful+ expect(response.status).to eq(200)post.reloadexpect(post.edit_reason).to eq("typo")expect(post.raw).to eq("edited body")@@ -307,7 +307,7 @@ describe PostsController doput "/posts/#{post.id}.json", params: param- expect(response).to be_successful+ expect(response.status).to eq(200)expect(TopicLink.count).to eq(1)end@@ -330,7 +330,7 @@ describe PostsController doPostDestroyer.new(moderator, first_post).destroyput "/posts/#{first_post.id}.json", params: update_params- expect(response).to be_successful+ expect(response.status).to eq(200)post.reloadexpect(post.raw).to eq('edited body')@@ -373,7 +373,7 @@ describe PostsController doit 'creates a bookmark' doput "/posts/#{post.id}/bookmark.json", params: { bookmarked: "true" }- expect(response).to be_successful+ expect(response.status).to eq(200)post_action = PostAction.find_by(user: user, post: post)expect(post_action.post_action_type_id).to eq(PostActionType.types[:bookmark])@@ -435,7 +435,7 @@ describe PostsController doapi_key: api_key.key}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(PostAction.where(post: post,user: user,@@ -460,7 +460,7 @@ describe PostsController doapi_username: user.username}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(PostAction.where(post: post,user: user,@@ -587,7 +587,7 @@ describe PostsController doit "can rebake the post" dosign_in(Fabricate(:moderator))put "/posts/#{post.id}/rebake.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endendend@@ -617,7 +617,7 @@ describe PostsController dowpid: 1}- expect(response).to be_successful+ expect(response.status).to eq(200)original = response.bodypost "/posts.json", params: {@@ -628,7 +628,7 @@ describe PostsController dowpid: 2}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to eq(original)end@@ -647,7 +647,7 @@ describe PostsController doreply_to_post_number: 1}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(post_1.topic.user.notifications.count).to eq(1)post_1.topic.user.notifications.destroy_all@@ -660,7 +660,7 @@ describe PostsController doimport_mode: true}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(post_1.topic.user.notifications.count).to eq(0)post "/posts.json", params: {@@ -672,7 +672,7 @@ describe PostsController doimport_mode: false}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(post_1.topic.user.notifications.count).to eq(1)endend@@ -694,7 +694,7 @@ describe PostsController dotitle: 'this is the test title for the topic'}- expect(response).to be_successful+ expect(response.status).to eq(200)parsed = ::JSON.parse(response.body)expect(parsed["action"]).to eq("enqueued")@@ -747,7 +747,7 @@ describe PostsController dotitle: 'when I eat s3 sometimes when not looking'}- expect(response).to be_successful+ expect(response.status).to eq(200)parsed = ::JSON.parse(response.body)expect(parsed["action"]).to eq("enqueued")@@ -780,7 +780,7 @@ describe PostsController doarchetype: Archetype.private_message}- expect(response).to be_successful+ expect(response.status).to eq(200)parsed = ::JSON.parse(response.body)post = Post.find(parsed['id'])@@ -796,7 +796,7 @@ describe PostsController donested_post: true}- expect(response).to be_successful+ expect(response.status).to eq(200)parsed = ::JSON.parse(response.body)expect(parsed['post']).to be_presentexpect(parsed['post']['cooked']).to be_present@@ -807,7 +807,7 @@ describe PostsController dotitle = "this is a title #{SecureRandom.hash}"post "/posts.json", params: { raw: raw, title: title, wpid: 1 }- expect(response).to be_successful+ expect(response.status).to eq(200)post "/posts.json", params: { raw: raw, title: title, wpid: 2 }expect(response).not_to be_successful@@ -835,7 +835,7 @@ describe PostsController dometa_data: { xyz: 'abc' }}- expect(response).to be_successful+ expect(response.status).to eq(200)new_post = Post.lasttopic = new_post.topic@@ -858,7 +858,7 @@ describe PostsController doimage_sizes: { width: '100', height: '200' }}- expect(response).to be_successful+ expect(response.status).to eq(200)new_post = Post.lasttopic = new_post.topic@@ -883,7 +883,7 @@ describe PostsController dotarget_usernames: "#{user_2.username},#{user_3.username}"}- expect(response).to be_successful+ expect(response.status).to eq(200)new_post = Post.lastnew_topic = Topic.last@@ -956,7 +956,7 @@ describe PostsController docategory: destination_category.id,shared_draft: 'true'}- expect(response).to be_successful+ expect(response.status).to eq(200)result = JSON.parse(response.body)topic = Topic.find(result['topic_id'])expect(topic.category_id).to eq(shared_category.id)@@ -983,7 +983,7 @@ describe PostsController dois_warning: true}- expect(response).to be_successful+ expect(response.status).to eq(200)new_topic = Topic.last@@ -1000,7 +1000,7 @@ describe PostsController dois_warning: false}- expect(response).to be_successful+ expect(response.status).to eq(200)new_topic = Topic.last@@ -1020,7 +1020,7 @@ describe PostsController dois_warning: true}- expect(response).to be_successful+ expect(response.status).to eq(200)new_topic = Topic.last@@ -1058,7 +1058,7 @@ describe PostsController doit "ensures staff can see the revisions" dosign_in(Fabricate(:admin))get "/posts/#{post.id}/revisions/#{post_revision.number}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endit "ensures poster can see the revisions" do@@ -1069,13 +1069,13 @@ describe PostsController dopr = Fabricate(:post_revision, user: user, post: post)get "/posts/#{pr.post_id}/revisions/#{pr.number}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endit "ensures trust level 4 can see the revisions" dosign_in(Fabricate(:user, trust_level: 4))get "/posts/#{post_revision.post_id}/revisions/#{post_revision.number}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -1085,7 +1085,7 @@ describe PostsController doit "ensures anyone can see the revisions" doget "/posts/#{post_revision.post_id}/revisions/#{post_revision.number}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -1099,7 +1099,7 @@ describe PostsController doit "also work on deleted post" dosign_in(admin)get "/posts/#{deleted_post_revision.post_id}/revisions/#{deleted_post_revision.number}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -1114,7 +1114,7 @@ describe PostsController doit "also work on deleted topic" dosign_in(admin)get "/posts/#{post_revision.post_id}/revisions/#{post_revision.number}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endendend@@ -1173,7 +1173,7 @@ describe PostsController doit "works!" doput "/posts/#{post_id}/revisions/#{revision_id}/revert.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endit "supports reverting posts in deleted topics" do@@ -1181,7 +1181,7 @@ describe PostsController doPostDestroyer.new(moderator, first_post).destroyput "/posts/#{post_id}/revisions/#{revision_id}/revert.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endendend@@ -1202,7 +1202,7 @@ describe PostsController doit "retrieves the body when you can see the post" doTopicEmbed.expects(:expanded_for).with(post).returns("full content")get "/posts/#{post.id}/expand-embed.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(::JSON.parse(response.body)['cooked']).to eq("full content")endend@@ -1220,7 +1220,7 @@ describe PostsController doit "can see the flagged posts when authorized" dosign_in(Fabricate(:moderator))get "/posts/system/flagged.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endit "only shows agreed and deferred flags" do@@ -1241,7 +1241,7 @@ describe PostsController dosign_in(Fabricate(:moderator))get "/posts/#{user.username}/flagged.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body).length).to eq(2)end@@ -1261,7 +1261,7 @@ describe PostsController doit "can see the deleted posts when authorized" dosign_in(Fabricate(:moderator))get "/posts/system/deleted.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endit "doesn't return secured categories for moderators if they don't have access" do@@ -1278,7 +1278,7 @@ describe PostsController dosign_in(Fabricate(:moderator))get "/posts/#{user.username}/deleted.json"- expect(response).to be_successful+ expect(response.status).to eq(200)data = JSON.parse(response.body)expect(data.length).to eq(0)@@ -1294,7 +1294,7 @@ describe PostsController dosign_in(Fabricate(:moderator))get "/posts/#{user.username}/deleted.json"- expect(response).to be_successful+ expect(response.status).to eq(200)data = JSON.parse(response.body)expect(data.length).to eq(0)@@ -1313,7 +1313,7 @@ describe PostsController dosign_in(Fabricate(:admin))get "/posts/#{user.username}/deleted.json"- expect(response).to be_successful+ expect(response.status).to eq(200)data = JSON.parse(response.body)expect(data.length).to eq(1)@@ -1327,7 +1327,7 @@ describe PostsController doit "can be viewed by anonymous" dopost = Fabricate(:post, raw: "123456789")get "/posts/#{post.id}/raw.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to eq("123456789")endend@@ -1338,7 +1338,7 @@ describe PostsController dopost = Fabricate(:post, topic: topic, post_number: 1, raw: "123456789")post.saveget "/raw/#{topic.id}/1.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to eq("123456789")endend@@ -1366,7 +1366,7 @@ describe PostsController doget "/u/#{user.username}/activity.rss"- expect(response).to be_successful+ expect(response.status).to eq(200)body = response.body@@ -1384,7 +1384,7 @@ describe PostsController doprivate_postget "/private-posts.rss"- expect(response).to be_successful+ expect(response.status).to eq(200)body = response.body@@ -1398,7 +1398,7 @@ describe PostsController dopublic_postprivate_postget "/private-posts.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)post_ids = json['private_posts'].map { |p| p['id'] }@@ -1415,7 +1415,7 @@ describe PostsController doget "/posts.rss"- expect(response).to be_successful+ expect(response.status).to eq(200)body = response.body@@ -1431,7 +1431,7 @@ describe PostsController dotopicless_postget "/posts.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)post_ids = json['latest_posts'].map { |p| p['id'] }@@ -1448,7 +1448,7 @@ describe PostsController dopost = Fabricate(:post, cooked: "WAt")get "/posts/#{post.id}/cooked.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json).to be_present@@ -1473,7 +1473,7 @@ describe PostsController dosign_in(Fabricate(:moderator))get "/posts/#{post.id}/raw-email.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json['raw_email']).to eq('email_content')@@ -1488,12 +1488,12 @@ describe PostsController doit 'can lock and unlock the post' doput "/posts/#{public_post.id}/locked.json", params: { locked: "true" }- expect(response).to be_successful+ expect(response.status).to eq(200)public_post.reloadexpect(public_post).to be_lockedput "/posts/#{public_post.id}/locked.json", params: { locked: "false" }- expect(response).to be_successful+ expect(response.status).to eq(200)public_post.reloadexpect(public_post).not_to be_lockedenddiff --git a/spec/requests/queued_posts_controller_spec.rb b/spec/requests/queued_posts_controller_spec.rbindex 421c0d9bc70..d8911e52e10 100644--- a/spec/requests/queued_posts_controller_spec.rb+++ b/spec/requests/queued_posts_controller_spec.rb@@ -24,7 +24,7 @@ describe QueuedPostsController doit 'returns the queued posts' doget "/queued-posts.json"- expect(response).to be_success+ expect(response.status).to eq(200)endend@@ -53,7 +53,7 @@ describe QueuedPostsController doqueued_post: { state: 'approved' }}- expect(response).to be_success+ expect(response.status).to eq(200)qp.reloadexpect(qp.state).to eq(QueuedPost.states[:approved])@@ -67,7 +67,7 @@ describe QueuedPostsController doqueued_post: { state: 'rejected' }}- expect(response).to be_success+ expect(response.status).to eq(200)qp.reloadexpect(qp.state).to eq(QueuedPost.states[:rejected])@@ -92,7 +92,7 @@ describe QueuedPostsController doqueued_post: changes}- expect(response).to be_success+ expect(response.status).to eq(200)queued_topic.reloadexpect(queued_topic.raw).to eq(changes[:raw])@@ -111,7 +111,7 @@ describe QueuedPostsController do}original_category = queued_reply.post_options['category']- expect(response).to be_success+ expect(response.status).to eq(200)queued_reply.reloadexpect(queued_reply.raw).to eq(changes[:raw])diff --git a/spec/requests/search_controller_spec.rb b/spec/requests/search_controller_spec.rbindex 1a5ab80d240..0990a0c1e85 100644--- a/spec/requests/search_controller_spec.rb+++ b/spec/requests/search_controller_spec.rb@@ -17,7 +17,7 @@ describe SearchController doterm: 'awesome', include_blurb: true}- expect(response).to be_successful+ expect(response.status).to eq(200)data = JSON.parse(response.body)expect(data['posts'][0]['id']).to eq(my_post.id)expect(data['posts'][0]['blurb']).to eq('this is my really awesome post')@@ -32,7 +32,7 @@ describe SearchController doterm: user.username, type_filter: 'topic'}- expect(response).to be_successful+ expect(response.status).to eq(200)data = JSON.parse(response.body)expect(data['posts'][0]['id']).to eq(my_post.id)@@ -42,7 +42,7 @@ describe SearchController doterm: user.username, type_filter: 'user'}- expect(response).to be_successful+ expect(response.status).to eq(200)data = JSON.parse(response.body)expect(data['posts']).to be_blank@@ -61,7 +61,7 @@ describe SearchController dosearch_for_id: true}- expect(response).to be_successful+ expect(response.status).to eq(200)data = JSON.parse(response.body)expect(data['topics'][0]['id']).to eq(post.topic_id)@@ -77,7 +77,7 @@ describe SearchController dosearch_for_id: true}- expect(response).to be_successful+ expect(response.status).to eq(200)data = JSON.parse(response.body)expect(data['topics'][0]['id']).to eq(my_post.topic_id)@@ -90,7 +90,7 @@ describe SearchController doSiteSetting.log_search_queries = trueget "/search/query.json", params: { term: 'wookie' }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(SearchLog.where(term: 'wookie')).to be_presentjson = JSON.parse(response.body)@@ -105,7 +105,7 @@ describe SearchController doit "doesn't log when disabled" doSiteSetting.log_search_queries = falseget "/search/query.json", params: { term: 'wookie' }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(SearchLog.where(term: 'wookie')).to be_blankendend@@ -114,14 +114,14 @@ describe SearchController doit "logs the search term" doSiteSetting.log_search_queries = trueget "/search.json", params: { q: 'bantha' }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(SearchLog.where(term: 'bantha')).to be_presentendit "doesn't log when disabled" doSiteSetting.log_search_queries = falseget "/search.json", params: { q: 'bantha' }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(SearchLog.where(term: 'bantha')).to be_blankendend@@ -155,7 +155,7 @@ describe SearchController doterm: 'test', search_context: { type: 'user', id: user.username }}- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -187,7 +187,7 @@ describe SearchController dosearch_result_type: 'topic'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(SearchLog.find(search_log_id).search_result_id).to be_blankend@@ -207,7 +207,7 @@ describe SearchController dosearch_result_type: 'user'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(SearchLog.find(search_log_id).search_result_id).to eq(12345)expect(SearchLog.find(search_log_id).search_result_type).to eq(SearchLog.search_result_types[:user])end@@ -228,7 +228,7 @@ describe SearchController dosearch_result_type: 'topic'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(SearchLog.find(search_log_id).search_result_id).to eq(22222)expect(SearchLog.find(search_log_id).search_result_type).to eq(SearchLog.search_result_types[:topic])end@@ -246,7 +246,7 @@ describe SearchController dosearch_result_type: 'topic'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(SearchLog.find(search_log_id).search_result_id).to be_blankend@@ -266,7 +266,7 @@ describe SearchController dosearch_result_type: 'category'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(SearchLog.find(search_log_id).search_result_id).to eq(23456)expect(SearchLog.find(search_log_id).search_result_type).to eq(SearchLog.search_result_types[:category])end@@ -288,7 +288,7 @@ describe SearchController dosearch_result_type: 'tag'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(SearchLog.find(search_log_id).search_result_id).to eq(tag.id)expect(SearchLog.find(search_log_id).search_result_type).to eq(SearchLog.search_result_types[:tag])enddiff --git a/spec/requests/session_controller_spec.rb b/spec/requests/session_controller_spec.rbindex 51bff909d03..2cb726282a1 100644--- a/spec/requests/session_controller_spec.rb+++ b/spec/requests/session_controller_spec.rb@@ -28,7 +28,7 @@ RSpec.describe SessionController doit 'returns the right response' doget "/session/email-login/adasdad"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(CGI.unescapeHTML(response.body)).to match(I18n.t('email_login.invalid_token')@@ -41,7 +41,7 @@ RSpec.describe SessionController doget "/session/email-login/#{email_token.token}"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(CGI.unescapeHTML(response.body)).to match(I18n.t('email_login.invalid_token')@@ -823,7 +823,7 @@ RSpec.describe SessionController dologin: user.username, password: 'sssss'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(::JSON.parse(response.body)['error']).to eq(I18n.t("login.incorrect_username_email_or_password"))@@ -837,7 +837,7 @@ RSpec.describe SessionController dologin: user.username, password: ('s' * (User.max_password_length + 1))}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(::JSON.parse(response.body)['error']).to eq(I18n.t("login.incorrect_username_email_or_password"))@@ -855,7 +855,7 @@ RSpec.describe SessionController dologin: user.username, password: 'myawesomepassword'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)['error']).to eq(I18n.t('login.suspended_with_reason',date: I18n.l(user.suspended_till, format: :date_only),reason: Rack::Utils.escape_html(user.suspend_reason)@@ -872,7 +872,7 @@ RSpec.describe SessionController dologin: user.username, password: 'myawesomepassword'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)['error']).to eq(I18n.t('login.not_activated'))endend@@ -885,7 +885,7 @@ RSpec.describe SessionController do}end- expect(response).to be_successful+ expect(response.status).to eq(200)expect(events.map { |event| event[:event_name] }).to contain_exactly(:user_logged_in, :user_first_logged_in)@@ -908,7 +908,7 @@ RSpec.describe SessionController dopassword: 'myawesomepassword',}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)['error']).to eq(I18n.t('login.invalid_second_factor_code'))@@ -923,7 +923,7 @@ RSpec.describe SessionController dosecond_factor_token: '00000000'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)['error']).to eq(I18n.t('login.invalid_second_factor_code'))@@ -937,7 +937,7 @@ RSpec.describe SessionController dopassword: 'myawesomepassword',second_factor_token: ROTP::TOTP.new(user_second_factor.data).now}- expect(response).to be_successful+ expect(response.status).to eq(200)user.reloadexpect(session[:current_user_id]).to eq(user.id)@@ -957,7 +957,7 @@ RSpec.describe SessionController dopost "/session.json", params: {login: "@" + user.username, password: 'myawesomepassword'}- expect(response).to be_successful+ expect(response.status).to eq(200)user.reloadexpect(session[:current_user_id]).to be_nil@@ -969,7 +969,7 @@ RSpec.describe SessionController dopost "/session.json", params: {login: "@" + user.username, password: 'myawesomepassword'}- expect(response).to be_successful+ expect(response.status).to eq(200)user.reloadexpect(session[:current_user_id]).to eq(user.id)@@ -981,7 +981,7 @@ RSpec.describe SessionController dopost "/session.json", params: {login: user.email, password: 'myawesomepassword'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(session[:current_user_id]).to eq(user.id)endend@@ -994,7 +994,7 @@ RSpec.describe SessionController dopost "/session.json", params: {login: username, password: 'myawesomepassword'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(::JSON.parse(response.body)['error']).not_to be_presentend@@ -1002,7 +1002,7 @@ RSpec.describe SessionController dopost "/session.json", params: {login: email, password: 'myawesomepassword'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(::JSON.parse(response.body)['error']).not_to be_presentendend@@ -1020,12 +1020,12 @@ RSpec.describe SessionController doendit "doesn't log in the user" do- expect(response).to be_successful+ expect(response.status).to eq(200)expect(session[:current_user_id]).to be_blankendit "shows the 'not approved' error message" do- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)['error']).to eq(I18n.t('login.not_approved'))@@ -1040,7 +1040,7 @@ RSpec.describe SessionController dopost "/session.json", params: {login: user.email, password: 'myawesomepassword'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(session[:current_user_id]).to eq(user.id)endend@@ -1063,7 +1063,7 @@ RSpec.describe SessionController dopost "/session.json", params: {login: user.username, password: 'myawesomepassword'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(session[:current_user_id]).to eq(user.id)end@@ -1076,7 +1076,7 @@ RSpec.describe SessionController dologin: user.username, password: 'myawesomepassword'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)['error']).to be_presentexpect(session[:current_user_id]).not_to eq(user.id)end@@ -1090,7 +1090,7 @@ RSpec.describe SessionController dologin: user.username, password: 'myawesomepassword'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(session[:current_user_id]).to eq(user.id)endend@@ -1105,13 +1105,13 @@ RSpec.describe SessionController doit "doesn't log in the user" dopost_login- expect(response).to be_successful+ expect(response.status).to eq(200)expect(session[:current_user_id]).to be_blankendit "shows the 'not activated' error message" dopost_login- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)['error']).to eq(I18n.t 'login.not_activated')@@ -1122,7 +1122,7 @@ RSpec.describe SessionController doit "shows the 'not approved' error message" dopost_login- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)['error']).to eq(I18n.t 'login.not_approved')@@ -1141,7 +1141,7 @@ RSpec.describe SessionController dologin: user.username, password: 'myawesomepassword'}- expect(response).to be_successful+ expect(response.status).to eq(200)endpost "/session.json", params: {@@ -1164,7 +1164,7 @@ RSpec.describe SessionController dosecond_factor_token: '000000'}- expect(response).to be_successful+ expect(response.status).to eq(200)endpost "/session.json", params: {@@ -1285,7 +1285,7 @@ RSpec.describe SessionController doit "returns the JSON for the user" doget "/session/current.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json['current_user']).to be_presentexpect(json['current_user']['id']).to eq(user.id)diff --git a/spec/requests/similar_topics_controller_spec.rb b/spec/requests/similar_topics_controller_spec.rbindex d6692bab3fb..93e234f22e5 100644--- a/spec/requests/similar_topics_controller_spec.rb+++ b/spec/requests/similar_topics_controller_spec.rb@@ -30,7 +30,7 @@ describe SimilarTopicsController doreindex_postsget "/topics/similar_to.json", params: { title: title, raw: raw }- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["similar_topics"].size).to eq(0)end@@ -48,7 +48,7 @@ describe SimilarTopicsController doget "/topics/similar_to.json", params: { title: title, raw: raw }- expect(response).to be_success+ expect(response.status).to eq(200)similar_topics = ::JSON.parse(response.body)["similar_topics"]expect(similar_topics.size).to eq(1)expect(similar_topics.first["topic_id"]).to eq(topic.id)@@ -66,7 +66,7 @@ describe SimilarTopicsController doit "passes a user through if logged in" doget "/topics/similar_to.json", params: { title: title, raw: raw }- expect(response).to be_success+ expect(response.status).to eq(200)similar_topics = ::JSON.parse(response.body)["similar_topics"].map { |topic| topic["topic_id"] }expect(similar_topics.size).to eq(2)expect(similar_topics).to include(topic.id)@@ -82,7 +82,7 @@ describe SimilarTopicsController doget "/topics/similar_to.json", params: { title: title, raw: raw }- expect(response).to be_success+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["similar_topics"].size).to eq(0)enddiff --git a/spec/requests/site_controller_spec.rb b/spec/requests/site_controller_spec.rbindex d57ca36da85..b084dec7b19 100644--- a/spec/requests/site_controller_spec.rb+++ b/spec/requests/site_controller_spec.rb@@ -32,7 +32,7 @@ describe SiteController doget "/site/statistics.json"json = JSON.parse(response.body)- expect(response).to be_successful+ expect(response.status).to eq(200)expect(json["topic_count"]).to be_presentexpect(json["post_count"]).to be_presentexpect(json["user_count"]).to be_presentdiff --git a/spec/requests/static_controller_spec.rb b/spec/requests/static_controller_spec.rbindex 994167fad76..490d2966dcf 100644--- a/spec/requests/static_controller_spec.rb+++ b/spec/requests/static_controller_spec.rb@@ -98,7 +98,7 @@ describe StaticController doit "should return the right response" doget "/faq"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to include(I18n.t('js.faq'))endend@@ -113,7 +113,7 @@ describe StaticController doit "renders the #{id} page" doget "/#{id}"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to include(text)endend@@ -150,7 +150,7 @@ describe StaticController doget "/login"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to include(PrettyText.cook(I18n.t('login_required.welcome_message', title: SiteSetting.title@@ -177,7 +177,7 @@ describe StaticController doget '/faq'- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to include(I18n.t('js.faq'))end@@ -186,7 +186,7 @@ describe StaticController doget '/guidelines'- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to include(I18n.t('guidelines'))endenddiff --git a/spec/requests/steps_controller_spec.rb b/spec/requests/steps_controller_spec.rbindex 44a6c9bdff0..6f304bf70a3 100644--- a/spec/requests/steps_controller_spec.rb+++ b/spec/requests/steps_controller_spec.rb@@ -40,7 +40,7 @@ describe StepsController dofields: { contact_email: "[email protected]" }}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(SiteSetting.contact_email).to eq("[email protected]")enddiff --git a/spec/requests/tags_controller_spec.rb b/spec/requests/tags_controller_spec.rbindex 3b58b6e89a4..9be7b71022c 100644--- a/spec/requests/tags_controller_spec.rb+++ b/spec/requests/tags_controller_spec.rb@@ -16,7 +16,7 @@ describe TagsController doit "should return the right response" doget "/tags.json"- expect(response).to be_successful+ expect(response.status).to eq(200)tags = JSON.parse(response.body)["tags"]expect(tags.length).to eq(1)@@ -41,7 +41,7 @@ describe TagsController doget "/tags.json"- expect(response).to be_successful+ expect(response.status).to eq(200)tags = JSON.parse(response.body)["tags"]expect(tags.length).to eq(2)@@ -57,7 +57,7 @@ describe TagsController doit "should return the right response" doget "/tags/test"- expect(response).to be_successful+ expect(response.status).to eq(200)endit "should handle invalid tags" do@@ -72,7 +72,7 @@ describe TagsController doit "should return the right response" doget "/tags/check.json", params: { tag_values: [tag.name] }- expect(response).to be_successful+ expect(response.status).to eq(200)tag = JSON.parse(response.body)["valid"].firstexpect(tag["value"]).to eq('test')@@ -141,7 +141,7 @@ describe TagsController doit "can see their own pm tags" doget "/tags/personal_messages/#{moderator.username}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)tag = JSON.parse(response.body)['tags']expect(tag[0]["id"]).to eq('test')@@ -156,7 +156,7 @@ describe TagsController doit "can see pm tags for regular user" doget "/tags/personal_messages/#{regular_user.username}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)tag = JSON.parse(response.body)['tags']expect(tag[0]["id"]).to eq('test')@@ -165,7 +165,7 @@ describe TagsController doit "can see their own pm tags" doget "/tags/personal_messages/#{admin.username}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)tag = JSON.parse(response.body)['tags']expect(tag[0]["id"]).to eq('test')@@ -195,7 +195,7 @@ describe TagsController docontext 'tagging enabled' doit "can filter by tag" doget "/tags/#{tag.name}/l/latest.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endit "can filter by two tags" do@@ -205,7 +205,7 @@ describe TagsController doadditional_tag_ids: other_tag.name}- expect(response).to be_successful+ expect(response.status).to eq(200)topic_ids = JSON.parse(response.body)["topic_list"]["topics"].map { |topic| topic["id"] }@@ -222,7 +222,7 @@ describe TagsController doadditional_tag_ids: "#{other_tag.name}/#{third_tag.name}"}- expect(response).to be_successful+ expect(response.status).to eq(200)topic_ids = JSON.parse(response.body)["topic_list"]["topics"].map { |topic| topic["id"] }@@ -239,7 +239,7 @@ describe TagsController doadditional_tag_ids: "notatag"}- expect(response).to be_successful+ expect(response.status).to eq(200)topic_ids = JSON.parse(response.body)["topic_list"]["topics"].map { |topic| topic["id"] }@@ -249,17 +249,17 @@ describe TagsController doit "can filter by category and tag" doget "/tags/c/#{category.slug}/#{tag.name}/l/latest.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endit "can filter by category, sub-category, and tag" doget "/tags/c/#{category.slug}/#{subcategory.slug}/#{tag.name}/l/latest.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endit "can filter by category, no sub-category, and tag" doget "/tags/c/#{category.slug}/none/#{tag.name}/l/latest.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endit "can handle subcategories with the same name" do@@ -272,7 +272,7 @@ describe TagsController dot = Fabricate(:topic, category_id: subcategory2.id, tags: [other_tag])get "/tags/c/#{category2.slug}/#{subcategory2.slug}/#{other_tag.name}/l/latest.json"- expect(response).to be_successful+ expect(response.status).to eq(200)topic_ids = JSON.parse(response.body)["topic_list"]["topics"].map { |topic| topic["id"] }@@ -284,7 +284,7 @@ describe TagsController dosign_in(Fabricate(:user))get "/tags/#{tag.name}/l/bookmarks.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endendend@@ -303,7 +303,7 @@ describe TagsController dotag_names = ['stuff', 'stinky', 'stumped']tag_names.each { |name| Fabricate(:tag, name: name) }get "/tags/filter/search.json", params: { q: 'stu' }- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["results"].map { |j| j["id"] }.sort).to eq(['stuff', 'stumped'])end@@ -312,7 +312,7 @@ describe TagsController doyup, nope = Fabricate(:tag, name: 'yup'), Fabricate(:tag, name: 'nope')category = Fabricate(:category, tags: [yup])get "/tags/filter/search.json", params: { q: 'nope', categoryId: category.id }- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["results"].map { |j| j["id"] }.sort).to eq([])expect(json["forbidden"]).to be_present@@ -322,7 +322,7 @@ describe TagsController doc = Fabricate(:private_category, group: Fabricate(:group))Fabricate(:topic, category: c, tags: [Fabricate(:tag, name: "cooltag")])get "/tags/filter/search.json", params: { q: "cool" }- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["results"].map { |j| j["id"] }).to eq(['cooltag'])end@@ -332,12 +332,12 @@ describe TagsController dotag_names.each { |name| Fabricate(:tag, name: name) }get "/tags/filter/search.json", params: { q: '房' }- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["results"].map { |j| j["id"] }).to eq(['房地产'])get "/tags/filter/search.json", params: { q: 'тема' }- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json["results"].map { |j| j["id"] }).to eq(['тема-в-разработке'])end@@ -354,7 +354,7 @@ describe TagsController doit 'deletes the tag' dotag = Fabricate(:tag)delete "/tags/#{tag.name}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(Tag.where(id: tag.id)).to be_emptyendenddiff --git a/spec/requests/topics_controller_spec.rb b/spec/requests/topics_controller_spec.rbindex f23881b74c5..39b8e3288e9 100644--- a/spec/requests/topics_controller_spec.rb+++ b/spec/requests/topics_controller_spec.rb@@ -15,7 +15,7 @@ RSpec.describe TopicsController doget "/t/#{topic.id}/wordpress.json", params: { best: 3 }- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)# The JSON has the data the wordpress plugin needs@@ -105,7 +105,7 @@ RSpec.describe TopicsController do}end.to change { Topic.count }.by(1)- expect(response).to be_successful+ expect(response.status).to eq(200)result = ::JSON.parse(response.body)@@ -127,7 +127,7 @@ RSpec.describe TopicsController do}end.to change { Topic.count }.by(1)- expect(response).to be_successful+ expect(response.status).to eq(200)result = JSON.parse(response.body)@@ -143,7 +143,7 @@ RSpec.describe TopicsController dopost "/t/#{topic.id}/move-posts.json", params: {post_ids: [p2.id]}- expect(response).to be_successful+ expect(response.status).to eq(200)result = ::JSON.parse(response.body)expect(result['success']).to eq(false)expect(result['url']).to be_blank@@ -193,7 +193,7 @@ RSpec.describe TopicsController dodestination_topic_id: dest_topic.id}- expect(response).to be_successful+ expect(response.status).to eq(200)result = ::JSON.parse(response.body)expect(result['success']).to eq(true)expect(result['url']).to be_present@@ -207,7 +207,7 @@ RSpec.describe TopicsController dopost_ids: [p2.id]}- expect(response).to be_successful+ expect(response.status).to eq(200)result = ::JSON.parse(response.body)expect(result['success']).to eq(false)expect(result['url']).to be_blank@@ -251,7 +251,7 @@ RSpec.describe TopicsController dodestination_topic_id: dest_topic.id}- expect(response).to be_successful+ expect(response.status).to eq(200)result = ::JSON.parse(response.body)expect(result['success']).to eq(true)expect(result['url']).to be_present@@ -317,7 +317,7 @@ RSpec.describe TopicsController do}topic.reloadp1.reload- expect(response).to be_successful+ expect(response.status).to eq(200)expect(topic.user.username).to eq(user_a.username)expect(p1.user.username).to eq(user_a.username)end@@ -327,7 +327,7 @@ RSpec.describe TopicsController dousername: user_a.username_lower, post_ids: [p1.id, p2.id]}- expect(response).to be_successful+ expect(response.status).to eq(200)p1.reloadp2.reload@@ -347,7 +347,7 @@ RSpec.describe TopicsController dousername: user_a.username_lower, post_ids: [p3.id]}- expect(response).to be_successful+ expect(response.status).to eq(200)t2.reloadp3.reloadexpect(t2.deleted_at).to be_nil@@ -392,7 +392,7 @@ RSpec.describe TopicsController dotimestamp: new_timestamp.to_f}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(topic.reload.created_at).to be_within_one_second_of(new_timestamp)expect(p1.reload.created_at).to be_within_one_second_of(new_timestamp)expect(p2.reload.created_at).to be_within_one_second_of(old_timestamp)@@ -424,7 +424,7 @@ RSpec.describe TopicsController doexpect doput "/t/#{topic.id}/clear-pin.json"end.to change { TopicUser.where(topic_id: topic.id, user_id: user.id).count }.by(1)- expect(response).to be_successful+ expect(response.status).to eq(200)endendend@@ -479,7 +479,7 @@ RSpec.describe TopicsController dostatus: 'closed', enabled: 'false'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(topic.reload.closed).to eq(false)expect(topic.topic_timers).to eq([])@@ -560,7 +560,7 @@ RSpec.describe TopicsController doput "/t/#{topic.id}/recover.json"topic.reloadpost.reload- expect(response).to be_successful+ expect(response.status).to eq(200)expect(topic.trashed?).to be_falseyexpect(post.trashed?).to be_falseyend@@ -595,7 +595,7 @@ RSpec.describe TopicsController doit 'succeeds' dodelete "/t/#{topic.id}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)topic.reloadexpect(topic.trashed?).to be_truthyend@@ -609,7 +609,7 @@ RSpec.describe TopicsController doit "returns JSON for the slug" doget "/t/id_for/#{topic.slug}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = ::JSON.parse(response.body)expect(json['topic_id']).to eq(topic.id)expect(json['url']).to eq(topic.url)@@ -785,7 +785,7 @@ RSpec.describe TopicsController doit 'correctly renders canoicals' doget "/t/#{topic.id}", params: { slug: topic.slug }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(css_select("link[rel=canonical]").length).to eq(1)expect(response.headers["Cache-Control"]).to eq("no-cache, no-store")end@@ -802,7 +802,7 @@ RSpec.describe TopicsController doFabricate(:post, topic: topic)get "/t/#{topic.id}.json", params: { slug: topic.slug }- expect(response).to be_successful+ expect(response.status).to eq(200)get "/t/#{topic.id}.json", params: { slug: "just-guessing" }expect(response.status).to eq(301)@@ -813,7 +813,7 @@ RSpec.describe TopicsController doit 'shows a topic correctly' doget "/t/#{topic.slug}/#{topic.id}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endit 'return 404 for an invalid page' do@@ -1042,7 +1042,7 @@ RSpec.describe TopicsController doSiteSetting.max_prints_per_hour_per_user = 10get "/t/#{topic.slug}/#{topic.id}/print", headers: { HTTP_USER_AGENT: "Rails Testing" }- expect(response).to be_successful+ expect(response.status).to eq(200)body = response.bodyexpect(body).to have_tag(:body, class: 'crawler')@@ -1108,20 +1108,20 @@ RSpec.describe TopicsController doit 'grabs the correct set of posts' doget "/t/#{topic.slug}/#{topic.id}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(extract_post_stream).to eq(@post_ids[0..1])get "/t/#{topic.slug}/#{topic.id}.json", params: { page: 1 }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(extract_post_stream).to eq(@post_ids[0..1])get "/t/#{topic.slug}/#{topic.id}.json", params: { page: 2 }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(extract_post_stream).to eq(@post_ids[2..3])post_number = topic.posts.pluck(:post_number).sort[3]get "/t/#{topic.slug}/#{topic.id}/#{post_number}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(extract_post_stream).to eq(@post_ids[-2..-1])endend@@ -1134,7 +1134,7 @@ RSpec.describe TopicsController doit 'shows the topic' doget "/t/#{topic.slug}/#{topic.id}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endend@@ -1150,7 +1150,7 @@ RSpec.describe TopicsController doit 'shows the topic if valid api key is provided' doget "/t/#{topic.slug}/#{topic.id}.json", params: { api_key: api_key.key }- expect(response).to be_successful+ expect(response.status).to eq(200)topic.reloadexpect(topic.views).to eq(1)end@@ -1226,7 +1226,7 @@ RSpec.describe TopicsController doexpect {get "/t/#{topic.id}.json"}.not_to change(IncomingLink, :count)- expect(response).to be_successful+ expect(response.status).to eq(200)endit "doesn't raise an error on a very long link" do@@ -1245,7 +1245,7 @@ RSpec.describe TopicsController dobody = response.body- expect(response).to be_successful+ expect(response.status).to eq(200)expect(body).to have_tag(:script, with: { src: '/assets/application.js' })expect(body).to_not have_tag(:meta, with: { name: 'fragment' })end@@ -1272,7 +1272,7 @@ RSpec.describe TopicsController dobody = response.body- expect(response).to be_successful+ expect(response.status).to eq(200)expect(body).to have_tag(:body, with: { class: 'crawler' })expect(body).to_not have_tag(:meta, with: { name: 'fragment' })end@@ -1288,7 +1288,7 @@ RSpec.describe TopicsController doget "/t/#{topic.id}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.cookies['cn']).to eq(nil)notification.reload@@ -1301,7 +1301,7 @@ RSpec.describe TopicsController doget "/t/#{topic.id}.json", headers: { "Discourse-Clear-Notifications" => "2828,100,#{notification.id}" }- expect(response).to be_successful+ expect(response.status).to eq(200)notification.reloadexpect(notification.read).to eq(true)end@@ -1323,7 +1323,7 @@ RSpec.describe TopicsController doit "uses the default locale" doget "/t/#{topic.id}.json", headers: headers("fr")- expect(response).to be_successful+ expect(response.status).to eq(200)expect(I18n.locale).to eq(:en)endend@@ -1335,7 +1335,7 @@ RSpec.describe TopicsController doget "/t/#{topic.id}.json", headers: headers("fr")- expect(response).to be_successful+ expect(response.status).to eq(200)expect(I18n.locale).to eq(:en)endend@@ -1353,7 +1353,7 @@ RSpec.describe TopicsController docontext "with an anonymous user" doit "uses the locale from the headers" doget "/t/#{topic.id}.json", headers: headers("fr")- expect(response).to be_successful+ expect(response.status).to eq(200)expect(I18n.locale).to eq(:fr)endend@@ -1364,7 +1364,7 @@ RSpec.describe TopicsController dosign_in(user)get "/t/#{topic.id}.json", headers: headers("fr")- expect(response).to be_successful+ expect(response.status).to eq(200)expect(I18n.locale).to eq(:fr)endend@@ -1377,7 +1377,7 @@ RSpec.describe TopicsController doSiteSetting.default_locale = "en"get "/t/#{topic.id}.json", headers: headers("zh-CN")- expect(response).to be_successful+ expect(response.status).to eq(200)expect(I18n.locale).to eq(:zh_CN)endend@@ -1388,7 +1388,7 @@ RSpec.describe TopicsController doSiteSetting.default_locale = 'en'get "/t/#{topic.id}.json", headers: headers("")- expect(response).to be_successful+ expect(response.status).to eq(200)expect(I18n.locale).to eq(:en)endend@@ -1398,14 +1398,14 @@ RSpec.describe TopicsController dodescribe "read only header" doit "returns no read only header by default" doget "/t/#{topic.id}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.headers['Discourse-Readonly']).to eq(nil)endit "returns a readonly header if the site is read only" doDiscourse.received_readonly!get "/t/#{topic.id}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.headers['Discourse-Readonly']).to eq('true')endend@@ -1416,7 +1416,7 @@ RSpec.describe TopicsController doit 'returns first posts of the topic' doget "/t/#{topic.id}/posts.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.content_type).to eq('application/json')endend@@ -1426,7 +1426,7 @@ RSpec.describe TopicsController doit 'renders rss of the topic' doget "/t/foo/#{topic.id}.rss"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.content_type).to eq('application/rss+xml')endend@@ -1473,7 +1473,7 @@ RSpec.describe TopicsController dotopic = Fabricate(:topic, user: sign_in(Fabricate(:admin)))put "/t/#{topic.id}/make-banner.json"- expect(response).to be_successful+ expect(response.status).to eq(200)topic.reloadexpect(topic.archetype).to eq(Archetype.banner)end@@ -1492,7 +1492,7 @@ RSpec.describe TopicsController dotopic = Fabricate(:topic, user: sign_in(Fabricate(:admin)), archetype: Archetype.banner)put "/t/#{topic.id}/remove-banner.json"- expect(response).to be_successful+ expect(response.status).to eq(200)topic.reloadexpect(topic.archetype).to eq(Archetype.default)end@@ -1601,7 +1601,7 @@ RSpec.describe TopicsController douser.user_stat.update_column(:new_since, old_date)put "/topics/reset-new.json"- expect(response).to be_successful+ expect(response.status).to eq(200)user.reloadexpect(user.user_stat.new_since.to_date).not_to eq(old_date.to_date)end@@ -1611,7 +1611,7 @@ RSpec.describe TopicsController doit "works" doget "/topics/feature_stats.json", params: { category_id: 1 }- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["pinned_in_category_count"]).to eq(0)expect(json["pinned_globally_count"]).to eq(0)@@ -1676,7 +1676,7 @@ RSpec.describe TopicsController dotopic.reloadexpect(topic.archetype).to eq(Archetype.private_message)- expect(response).to be_successful+ expect(response.status).to eq(200)result = ::JSON.parse(response.body)expect(result['success']).to eq(true)@@ -1702,7 +1702,7 @@ RSpec.describe TopicsController dotopic.reloadexpect(topic.archetype).to eq(Archetype.default)- expect(response).to be_successful+ expect(response.status).to eq(200)result = ::JSON.parse(response.body)expect(result['success']).to eq(true)@@ -1724,7 +1724,7 @@ RSpec.describe TopicsController dotimings: { post_1.post_number => 2 }}- expect(response).to be_successful+ expect(response.status).to eq(200)post_timing = PostTiming.first@@ -1772,7 +1772,7 @@ RSpec.describe TopicsController dostatus_type: TopicTimer.types[1]}- expect(response).to be_successful+ expect(response.status).to eq(200)topic_status_update = TopicTimer.last@@ -1798,7 +1798,7 @@ RSpec.describe TopicsController dostatus_type: TopicTimer.types[1]}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(topic.reload.public_topic_timer).to eq(nil)json = JSON.parse(response.body)@@ -1816,7 +1816,7 @@ RSpec.describe TopicsController docategory_id: topic.category_id}- expect(response).to be_successful+ expect(response.status).to eq(200)topic_status_update = TopicTimer.last@@ -2036,7 +2036,7 @@ RSpec.describe TopicsController dolet!(:shared_draft) { Fabricate(:shared_draft, topic: topic, category: category) }it "allows staff to update the category id" doput "/t/#{topic.id}/shared-draft.json", params: { category_id: other_cat.id }- expect(response).to be_successful+ expect(response.status).to eq(200)topic.reloadexpect(topic.shared_draft.category_id).to eq(other_cat.id)end@@ -2045,7 +2045,7 @@ RSpec.describe TopicsController docontext "without a shared draft" doit "allows staff to update the category id" doput "/t/#{topic.id}/shared-draft.json", params: { category_id: other_cat.id }- expect(response).to be_successful+ expect(response.status).to eq(200)topic.reloadexpect(topic.shared_draft.category_id).to eq(other_cat.id)enddiff --git a/spec/requests/uploads_controller_spec.rb b/spec/requests/uploads_controller_spec.rbindex 9fa184f0e5c..fac1a98d8d2 100644--- a/spec/requests/uploads_controller_spec.rb+++ b/spec/requests/uploads_controller_spec.rb@@ -122,7 +122,7 @@ describe UploadsController dofor_private_message: "true",}- expect(response).to be_successful+ expect(response.status).to eq(200)id = JSON.parse(response.body)["id"]expect(id).to be_presentend@@ -137,7 +137,7 @@ describe UploadsController dotype: "composer",}- expect(response).to be_successful+ expect(response.status).to eq(200)data = JSON.parse(response.body)expect(data["id"]).to be_presentenddiff --git a/spec/requests/user_avatars_controller_spec.rb b/spec/requests/user_avatars_controller_spec.rbindex 0d86117abc4..be10954e8aa 100644--- a/spec/requests/user_avatars_controller_spec.rb+++ b/spec/requests/user_avatars_controller_spec.rb@@ -59,7 +59,7 @@ describe UserAvatarsController doget "/user_avatar/default/#{user.username}/51/#{upload.id}.png"- expect(response).to be_successful+ expect(response.status).to eq(200)endendenddiff --git a/spec/requests/user_badges_controller_spec.rb b/spec/requests/user_badges_controller_spec.rbindex 84b1b2ebbb7..f565caa1a7f 100644--- a/spec/requests/user_badges_controller_spec.rb+++ b/spec/requests/user_badges_controller_spec.rb@@ -11,7 +11,7 @@ describe UserBadgesController doUserBadge.create!(badge: badge, user: user, post_id: p.id, granted_by_id: -1, granted_at: Time.now)get "/user_badges.json", params: { badge_id: badge.id }- expect(response).to be_successful+ expect(response.status).to eq(200)parsed = JSON.parse(response.body)expect(parsed["topics"]).to eq(nil)diff --git a/spec/requests/users_controller_spec.rb b/spec/requests/users_controller_spec.rbindex 1714816a005..a99aacba9ac 100644--- a/spec/requests/users_controller_spec.rb+++ b/spec/requests/users_controller_spec.rb@@ -64,7 +64,7 @@ describe UsersController do:user_logged_in, :user_first_logged_in)- expect(response).to be_successful+ expect(response.status).to eq(200)expect(flash[:error]).to be_blankexpect(session[:current_user_id]).to be_present@@ -81,7 +81,7 @@ describe UsersController doendit 'should return the right response' do- expect(response).to be_successful+ expect(response.status).to eq(200)expect(CGI.unescapeHTML(response.body)).to include(I18n.t('activation.approval_required'))@@ -116,7 +116,7 @@ describe UsersController doit "returns success" doSiteSetting.login_required = trueget "/u/password-reset/#{token}"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(CGI.unescapeHTML(response.body)).to include(I18n.t('password_reset.no_token'))endend@@ -127,7 +127,7 @@ describe UsersController doendit 'disallows login' do- expect(response).to be_successful+ expect(response.status).to eq(200)expect(CGI.unescapeHTML(response.body)).to include(I18n.t('password_reset.no_token'))@@ -144,7 +144,7 @@ describe UsersController doit 'disallows login' doget "/u/password-reset/ev!l_trout@!"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(CGI.unescapeHTML(response.body)).to include(I18n.t('password_reset.no_token'))@@ -159,7 +159,7 @@ describe UsersController doit "responds with proper error message" doput "/u/password-reset/evil_trout!.json", params: { password: "awesomeSecretPassword" }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)["message"]).to eq(I18n.t('password_reset.no_token'))expect(session[:current_user_id]).to be_blankend@@ -189,7 +189,7 @@ describe UsersController do:user_logged_in, :user_first_logged_in)- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to include('{"is_developer":false,"admin":false,"second_factor_required":false}')expect(session["password-#{token}"]).to be_blank@@ -294,7 +294,7 @@ describe UsersController doit "fails when the password is blank" doput "/u/password-reset/#{token}.json", params: { password: '' }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)["errors"]).to be_presentexpect(session[:current_user_id]).to be_blankend@@ -302,7 +302,7 @@ describe UsersController doit "fails when the password is too long" doput "/u/password-reset/#{token}.json", params: { password: ('x' * (User.max_password_length + 1)) }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)["errors"]).to be_presentexpect(session[:current_user_id]).to be_blankend@@ -310,7 +310,7 @@ describe UsersController doit "logs in the user" doput "/u/password-reset/#{token}.json", params: { password: 'ksjafh928r' }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)["errors"]).to be_blankexpect(session[:current_user_id]).to be_presentend@@ -331,14 +331,14 @@ describe UsersController doit "token doesn't match any records" doemail_token = user.email_tokens.create(email: user.email)get "/u/confirm-email-token/#{SecureRandom.hex}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(email_token.reload.confirmed).to eq(false)endit "token matches" doemail_token = user.email_tokens.create(email: user.email)get "/u/confirm-email-token/#{email_token.token}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(email_token.reload.confirmed).to eq(true)endend@@ -442,11 +442,11 @@ describe UsersController douser.save!post "/u/toggle-anon.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(session[:current_user_id]).to eq(AnonymousShadowCreator.get(user).id)post "/u/toggle-anon.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(session[:current_user_id]).to eq(user.id)endend@@ -934,7 +934,7 @@ describe UsersController doit "should succeed without the optional field" dopost "/u.json", params: create_params- expect(response).to be_successful+ expect(response.status).to eq(200)inserted = User.find_by_email(@user.email)expect(inserted).to be_presentexpect(inserted.custom_fields).to be_present@@ -946,7 +946,7 @@ describe UsersController doit "should succeed with the optional field" docreate_params[:user_fields][optional_field.id.to_s] = 'value3'post "/u.json", params: create_params.merge(create_params)- expect(response).to be_successful+ expect(response.status).to eq(200)inserted = User.find_by_email(@user.email)expect(inserted).to be_presentexpect(inserted.custom_fields).to be_present@@ -958,7 +958,7 @@ describe UsersController doit "trims excessively long fields" docreate_params[:user_fields][optional_field.id.to_s] = ('x' * 3000)post "/u.json", params: create_params.merge(create_params)- expect(response).to be_successful+ expect(response.status).to eq(200)inserted = User.find_by_email(@user.email)val = inserted.custom_fields["user_field_#{optional_field.id}"]@@ -980,7 +980,7 @@ describe UsersController doit "should succeed" dopost "/u.json", params: create_params- expect(response).to be_successful+ expect(response.status).to eq(200)inserted = User.find_by_email(@user.email)expect(inserted).to be_presentexpect(inserted.custom_fields).not_to be_present@@ -1073,7 +1073,7 @@ describe UsersController doit 'should succeed in normal circumstances' doput "/u/#{user.username}/preferences/username.json", params: { new_username: new_username }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(user.reload.username).to eq(new_username)end@@ -1097,7 +1097,7 @@ describe UsersController doput "/u/#{user.username}/preferences/username.json", params: { new_username: new_username }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(UserHistory.where(action: UserHistory.actions[:change_username], target_user_id: user.id, acting_user_id: acting_user.id)).to be_presentexpect(user.reload.username).to eq(new_username)end@@ -1221,7 +1221,7 @@ describe UsersController douser = Fabricate(:user)get "/u/#{user.username}/invited.json", params: { username: user.username }- expect(response).to be_successful+ expect(response.status).to eq(200)endit 'filters by email' do@@ -1366,14 +1366,14 @@ describe UsersController doit "should be able to update a user" doput "/u/#{user.username}.json", params: { name: 'test.test' }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(user.reload.name).to eq('test.test')endit "should be able to update a user" doput "/u/#{user.username}.json", params: { name: 'testing123' }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(user.reload.name).to eq('testing123')endend@@ -1391,7 +1391,7 @@ describe UsersController douser_fields: { user_field.id.to_s => 'happy' }}- expect(response).to be_successful+ expect(response.status).to eq(200)user.reload@@ -1417,7 +1417,7 @@ describe UsersController dowatched_tags: "#{tags[0].name},#{tags[1].name}"}- expect(response).to be_successful+ expect(response.status).to eq(200)user.reload@@ -1460,7 +1460,7 @@ describe UsersController doit "should update the user field" doput "/u/#{user.username}.json", params: { name: 'Jim Tom', user_fields: { user_field.id.to_s => 'happy' } }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(user.user_fields[user_field.id.to_s]).to eq 'happy'end@@ -1480,13 +1480,13 @@ describe UsersController doit "should retain existing user fields" doput "/u/#{user.username}.json", params: { name: 'Jim Tom', user_fields: { user_field.id.to_s => 'happy', optional_field.id.to_s => 'feet' } }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(user.user_fields[user_field.id.to_s]).to eq('happy')expect(user.user_fields[optional_field.id.to_s]).to eq('feet')put "/u/#{user.username}.json", params: { name: 'Jim Tom', user_fields: { user_field.id.to_s => 'sad' } }- expect(response).to be_successful+ expect(response.status).to eq(200)user.reload@@ -1501,7 +1501,7 @@ describe UsersController doit "does not update the user field" doput "/u/#{user.username}.json", params: { name: 'Jim Tom', user_fields: { user_field.id.to_s => 'happy' } }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(user.user_fields[user_field.id.to_s]).to be_blankendend@@ -1748,7 +1748,7 @@ describe UsersController doit 'can successfully pick the system avatar' doput "/u/#{user.username}/preferences/avatar/pick.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(user.reload.uploaded_avatar_id).to eq(nil)end@@ -1757,7 +1757,7 @@ describe UsersController doupload_id: upload.id, type: "gravatar"}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(user.reload.uploaded_avatar_id).to eq(upload.id)expect(user.user_avatar.reload.gravatar_upload_id).to eq(upload.id)end@@ -1767,7 +1767,7 @@ describe UsersController doupload_id: upload.id, type: "custom"}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(user.reload.uploaded_avatar_id).to eq(upload.id)expect(user.user_avatar.reload.custom_upload_id).to eq(upload.id)end@@ -1807,7 +1807,7 @@ describe UsersController dodelete "/u/#{user.username}/preferences/user_image.json", params: { type: 'profile_background' }expect(user.reload.user_profile.profile_background).to eq("")- expect(response).to be_successful+ expect(response.status).to eq(200)endendend@@ -1843,7 +1843,7 @@ describe UsersController doit "deletes your account when you're allowed to" doUserDestroyer.any_instance.expects(:destroy).with(user, anything).returns(user)delete "/u/#{user.username}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endendend@@ -1894,7 +1894,7 @@ describe UsersController doget "/u/#{Fabricate(:user).username}/emails.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["email"]).to be_presentexpect(json["associated_accounts"]).to be_present@@ -1906,7 +1906,7 @@ describe UsersController doget "/u/#{inactive_user.username}/emails.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["email"]).to be_presentexpect(json["associated_accounts"]).to be_present@@ -2034,7 +2034,7 @@ describe UsersController docreate_post(user: user)get "/u/#{user.username_lower}/summary.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["user_summary"]["topic_count"]).to eq(1)@@ -2058,7 +2058,7 @@ describe UsersController doac = AdminConfirmation.new(user, Fabricate(:admin))ac.create_confirmationget "/u/confirm-admin/#{ac.token}.josn"- expect(response).to be_successful+ expect(response.status).to eq(200)user.reloadexpect(user.admin?).to eq(false)@@ -2071,7 +2071,7 @@ describe UsersController doac = AdminConfirmation.new(user, admin)ac.create_confirmationget "/u/confirm-admin/#{ac.token}.josn", params: { token: ac.token }- expect(response).to be_successful+ expect(response.status).to eq(200)user.reloadexpect(user.admin?).to eq(false)@@ -2096,7 +2096,7 @@ describe UsersController doac = AdminConfirmation.new(user, Fabricate(:admin))ac.create_confirmationpost "/u/confirm-admin/#{ac.token}.josn"- expect(response).to be_successful+ expect(response.status).to eq(200)user.reloadexpect(user.admin?).to eq(true)@@ -2285,7 +2285,7 @@ describe UsersController doit "returns success" doget "/u/#{user.username}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)["user"]["username"]).to eq(user.username)end@@ -2320,7 +2320,7 @@ describe UsersController doit 'returns success' doget "/u/#{user.username}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["user"]["has_title_badges"]).to eq(false)@@ -2341,7 +2341,7 @@ describe UsersController doSiteSetting.show_inactive_accounts = trueinactive = Fabricate(:user, active: false)get "/u/#{inactive.username}.json"- expect(response).to be_successful+ expect(response.status).to eq(200)endit "raises an error on invalid access" do@@ -2374,7 +2374,7 @@ describe UsersController doit "returns fetch for a matching external_id" doget "/u/by-external/997.json"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)["user"]["username"]).to eq(user.username)end@@ -2414,7 +2414,7 @@ describe UsersController doit "should be able to view a user" doget "/u/#{user.username}"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to include(user.username)end@@ -2426,7 +2426,7 @@ describe UsersController doit "should be able to view a user" doget "/u/#{user.username}"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to include(user.username)endend@@ -2435,7 +2435,7 @@ describe UsersController dodescribe '#badges' doit "renders fine by default" doget "/u/#{user.username}/badges"- expect(response).to be_successful+ expect(response.status).to eq(200)endit "fails if badges are disabled" do@@ -2449,7 +2449,7 @@ describe UsersController doit "returns a message when no session is present" doget "/u/account-created"- expect(response).to be_successful+ expect(response.status).to eq(200)body = response.body@@ -2470,7 +2470,7 @@ describe UsersController douser = create_userget "/u/account-created"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to include("{\"message\":\"#{I18n.t("login.activate_email", email: user.email).gsub!("</", "<\\/")}\",\"show_controls\":true,\"username\":\"#{user.username}\",\"email\":\"#{user.email}\"}"@@ -2491,14 +2491,14 @@ describe UsersController doit "searches when provided the term only" doget "/u/search/users.json", params: { term: user.name.split(" ").last }- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["users"].map { |u| u["username"] }).to include(user.username)endit "searches when provided the topic only" doget "/u/search/users.json", params: { topic_id: topic.id }- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["users"].map { |u| u["username"] }).to include(user.username)end@@ -2508,7 +2508,7 @@ describe UsersController doterm: user.name.split(" ").last, topic_id: topic.id}- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["users"].map { |u| u["username"] }).to include(user.username)end@@ -2529,7 +2529,7 @@ describe UsersController doterm: user.name.split(" ").last, topic_id: private_topic.id, topic_allowed_users: "true"}- expect(response).to be_successful+ expect(response.status).to eq(200)json = JSON.parse(response.body)expect(json["users"].map { |u| u["username"] }).to_not include(user.username)expect(json["users"].map { |u| u["username"] }).to include(privileged_user.username)@@ -2591,7 +2591,7 @@ describe UsersController doit "only returns visible groups" doget "/u/search/users.json", params: { include_groups: "true" }- expect(response).to be_successful+ expect(response.status).to eq(200)groups = JSON.parse(response.body)["groups"]@@ -2605,7 +2605,7 @@ describe UsersController doinclude_messageable_groups: 'false'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)).not_to have_key(:groups)end@@ -2615,7 +2615,7 @@ describe UsersController doinclude_messageable_groups: 'true'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)["groups"].map { |group| group['name'] }).to contain_exactly(messageable_group.name, Group.find(Group::AUTO_GROUPS[:moderators]).name)@@ -2627,7 +2627,7 @@ describe UsersController doinclude_mentionable_groups: 'true'}- expect(response).to be_successful+ expect(response.status).to eq(200)groups = JSON.parse(response.body)["groups"]@@ -2643,7 +2643,7 @@ describe UsersController doinclude_messageable_groups: 'false'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)).not_to have_key(:groups)get "/u/search/users.json", params: {@@ -2651,7 +2651,7 @@ describe UsersController doinclude_messageable_groups: 'true'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)).not_to have_key(:groups)get "/u/search/users.json", params: {@@ -2659,7 +2659,7 @@ describe UsersController doinclude_mentionable_groups: 'true'}- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)).not_to have_key(:groups)endend@@ -2687,7 +2687,7 @@ describe UsersController doit "enqueues the right email" dopost "/u/email-login.json", params: { login: user.email }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)['user_found']).to eq(true)job_args = Jobs::CriticalUserEmail.jobs.last["args"].first@@ -2713,7 +2713,7 @@ describe UsersController doit 'should not enqueue the email to login' dopost "/u/email-login.json", params: { login: '@random' }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body)['user_found']).to eq(false)expect(Jobs::CriticalUserEmail.jobs).to eq([])end@@ -2724,7 +2724,7 @@ describe UsersController doSiteSetting.hide_email_address_taken = truepost "/u/email-login.json", params: { login: user.email }- expect(response).to be_successful+ expect(response.status).to eq(200)expect(JSON.parse(response.body).has_key?('user_found')).to eq(false)endenddiff --git a/spec/requests/users_email_controller_spec.rb b/spec/requests/users_email_controller_spec.rbindex 4d690590f3a..5206a22fb44 100644--- a/spec/requests/users_email_controller_spec.rb+++ b/spec/requests/users_email_controller_spec.rb@@ -6,7 +6,7 @@ describe UsersEmailController doit 'errors out for invalid tokens' doget "/u/authorize-email/asdfasdf"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to include(I18n.t('change_email.already_done'))end@@ -21,7 +21,7 @@ describe UsersEmailController doit 'confirms with a correct token' doget "/u/authorize-email/#{user.email_tokens.last.token}"- expect(response).to be_successful+ expect(response.status).to eq(200)body = CGI.unescapeHTML(response.body)@@ -52,7 +52,7 @@ describe UsersEmailController do:user_logged_in, :user_first_logged_in)- expect(response).to be_successful+ expect(response.status).to eq(200)expect(response.body).to include(I18n.t('change_email.confirmed'))user.reload@@ -66,7 +66,7 @@ describe UsersEmailController doget "/u/authorize-email/#{user.email_tokens.last.token}"- expect(response).to be_successful+ expect(response.status).to eq(200)expect(group.reload.users.include?(user)).to eq(true)end@@ -171,7 +171,7 @@ describe UsersEmailController doemail: other_user.email}- expect(response).to be_successful+ expect(response.status).to eq(200)endendenddiff --git a/spec/requests/webhooks_controller_spec.rb b/spec/requests/webhooks_controller_spec.rbindex e0ed4db5cf1..ec94b939423 100644--- a/spec/requests/webhooks_controller_spec.rb+++ b/spec/requests/webhooks_controller_spec.rb@@ -27,7 +27,7 @@ describe WebhooksController do"signature" => signature}- expect(response).to be_successful+ expect(response.status).to eq(200)email_log.reloadexpect(email_log.bounced).to eq(true)@@ -51,7 +51,7 @@ describe WebhooksController do]}- expect(response).to be_successful+ expect(response.status).to eq(200)email_log.reloadexpect(email_log.bounced).to eq(true)@@ -71,7 +71,7 @@ describe WebhooksController do"CustomID" => message_id}- expect(response).to be_successful+ expect(response.status).to eq(200)email_log.reloadexpect(email_log.bounced).to eq(true)@@ -96,7 +96,7 @@ describe WebhooksController do}]}- expect(response).to be_successful+ expect(response.status).to eq(200)email_log.reloadexpect(email_log.bounced).to eq(true)@@ -123,7 +123,7 @@ describe WebhooksController do}]}- expect(response).to be_successful+ expect(response.status).to eq(200)email_log.reloadexpect(email_log.bounced).to eq(true)diff --git a/spec/support/integration_helpers.rb b/spec/support/integration_helpers.rbindex 7269dcd5305..f2d72771c65 100644--- a/spec/support/integration_helpers.rb+++ b/spec/support/integration_helpers.rb@@ -2,7 +2,7 @@ module IntegrationHelpersdef create_userget "/u/hp.json"- expect(response).to be_successful+ expect(response.status).to eq(200)body = JSON.parse(response.body)honeypot = body["value"]@@ -17,7 +17,7 @@ module IntegrationHelperschallenge: challenge.reverse}- expect(response).to be_successful+ expect(response.status).to eq(200)body = JSON.parse(response.body)User.find(body["user_id"])