diff options
author | Matt Jankowski <mjankowski@thoughtbot.com> | 2017-04-28 09:12:37 -0400 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-04-28 15:12:37 +0200 |
commit | 9566893cc973671f151ceabf266d260ebba57492 (patch) | |
tree | 1f575905b552ba758a08300b96c91122e3ef6dc4 /spec/controllers/admin | |
parent | 0e2589867f2a54fe9a71c20560d90d7f77c12bd3 (diff) |
More controller specs (#2561)
* Add render_views in more places * Delegate methods from account to user with allow nil true, so that admin accounts show view renders when missing a user * Use actual account instances in authorize follow controller spec
Diffstat (limited to 'spec/controllers/admin')
8 files changed, 16 insertions, 0 deletions
diff --git a/spec/controllers/admin/accounts_controller_spec.rb b/spec/controllers/admin/accounts_controller_spec.rb index 47b1267e8..305260475 100644 --- a/spec/controllers/admin/accounts_controller_spec.rb +++ b/spec/controllers/admin/accounts_controller_spec.rb @@ -1,6 +1,8 @@ require 'rails_helper' RSpec.describe Admin::AccountsController, type: :controller do + render_views + before do sign_in Fabricate(:user, admin: true), scope: :user end diff --git a/spec/controllers/admin/domain_blocks_controller_spec.rb b/spec/controllers/admin/domain_blocks_controller_spec.rb index 9d8735ef2..4578efb02 100644 --- a/spec/controllers/admin/domain_blocks_controller_spec.rb +++ b/spec/controllers/admin/domain_blocks_controller_spec.rb @@ -1,6 +1,8 @@ require 'rails_helper' RSpec.describe Admin::DomainBlocksController, type: :controller do + render_views + before do sign_in Fabricate(:user, admin: true), scope: :user end diff --git a/spec/controllers/admin/instances_controller_spec.rb b/spec/controllers/admin/instances_controller_spec.rb index c50ea352f..37fa8dd9a 100644 --- a/spec/controllers/admin/instances_controller_spec.rb +++ b/spec/controllers/admin/instances_controller_spec.rb @@ -1,6 +1,8 @@ require 'rails_helper' RSpec.describe Admin::InstancesController, type: :controller do + render_views + before do sign_in Fabricate(:user, admin: true), scope: :user end diff --git a/spec/controllers/admin/pubsubhubbub_controller_spec.rb b/spec/controllers/admin/pubsubhubbub_controller_spec.rb index 068bd09a6..c2bab5dac 100644 --- a/spec/controllers/admin/pubsubhubbub_controller_spec.rb +++ b/spec/controllers/admin/pubsubhubbub_controller_spec.rb @@ -2,6 +2,8 @@ require 'rails_helper' RSpec.describe Admin::PubsubhubbubController, type: :controller do + render_views + describe 'GET #index' do before do sign_in Fabricate(:user, admin: true), scope: :user diff --git a/spec/controllers/admin/reported_statuses_controller_spec.rb b/spec/controllers/admin/reported_statuses_controller_spec.rb index 4d6926e1a..dea5ea55d 100644 --- a/spec/controllers/admin/reported_statuses_controller_spec.rb +++ b/spec/controllers/admin/reported_statuses_controller_spec.rb @@ -1,6 +1,8 @@ require 'rails_helper' describe Admin::ReportedStatusesController do + render_views + let(:user) { Fabricate(:user, admin: true) } before do sign_in user, scope: :user diff --git a/spec/controllers/admin/resets_controller_spec.rb b/spec/controllers/admin/resets_controller_spec.rb index 283ab029f..a0a77478e 100644 --- a/spec/controllers/admin/resets_controller_spec.rb +++ b/spec/controllers/admin/resets_controller_spec.rb @@ -1,6 +1,8 @@ require 'rails_helper' describe Admin::ResetsController do + render_views + let(:account) { Fabricate(:account, user: Fabricate(:user)) } before do sign_in Fabricate(:user, admin: true), scope: :user diff --git a/spec/controllers/admin/silences_controller_spec.rb b/spec/controllers/admin/silences_controller_spec.rb index 7c541d797..16b326542 100644 --- a/spec/controllers/admin/silences_controller_spec.rb +++ b/spec/controllers/admin/silences_controller_spec.rb @@ -1,6 +1,8 @@ require 'rails_helper' describe Admin::SilencesController do + render_views + let(:account) { Fabricate(:account) } before do sign_in Fabricate(:user, admin: true), scope: :user diff --git a/spec/controllers/admin/suspensions_controller_spec.rb b/spec/controllers/admin/suspensions_controller_spec.rb index 9096f067e..2d9adc23d 100644 --- a/spec/controllers/admin/suspensions_controller_spec.rb +++ b/spec/controllers/admin/suspensions_controller_spec.rb @@ -1,6 +1,8 @@ require 'rails_helper' describe Admin::SuspensionsController do + render_views + let(:account) { Fabricate(:account) } before do sign_in Fabricate(:user, admin: true), scope: :user |