about summary refs log tree commit diff
path: root/spec/controllers/api/v1/admin
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/api/v1/admin')
-rw-r--r--spec/controllers/api/v1/admin/canonical_email_blocks_controller_spec.rb23
-rw-r--r--spec/controllers/api/v1/admin/dimensions_controller_spec.rb23
-rw-r--r--spec/controllers/api/v1/admin/email_domain_blocks_controller_spec.rb23
-rw-r--r--spec/controllers/api/v1/admin/ip_blocks_controller_spec.rb23
-rw-r--r--spec/controllers/api/v1/admin/measures_controller_spec.rb23
-rw-r--r--spec/controllers/api/v1/admin/retention_controller_spec.rb23
-rw-r--r--spec/controllers/api/v1/admin/trends/links_controller_spec.rb23
-rw-r--r--spec/controllers/api/v1/admin/trends/statuses_controller_spec.rb23
-rw-r--r--spec/controllers/api/v1/admin/trends/tags_controller_spec.rb23
9 files changed, 207 insertions, 0 deletions
diff --git a/spec/controllers/api/v1/admin/canonical_email_blocks_controller_spec.rb b/spec/controllers/api/v1/admin/canonical_email_blocks_controller_spec.rb
new file mode 100644
index 000000000..3acae843a
--- /dev/null
+++ b/spec/controllers/api/v1/admin/canonical_email_blocks_controller_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+describe Api::V1::Admin::CanonicalEmailBlocksController do
+  render_views
+
+  let(:user)    { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
+  let(:token)   { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'admin:read') }
+  let(:account) { Fabricate(:account) }
+
+  before do
+    allow(controller).to receive(:doorkeeper_token) { token }
+  end
+
+  describe 'GET #index' do
+    it 'returns http success' do
+      get :index, params: { account_id: account.id, limit: 2 }
+
+      expect(response).to have_http_status(200)
+    end
+  end
+end
diff --git a/spec/controllers/api/v1/admin/dimensions_controller_spec.rb b/spec/controllers/api/v1/admin/dimensions_controller_spec.rb
new file mode 100644
index 000000000..ea18efe38
--- /dev/null
+++ b/spec/controllers/api/v1/admin/dimensions_controller_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+describe Api::V1::Admin::DimensionsController do
+  render_views
+
+  let(:user)    { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
+  let(:token)   { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'admin:read') }
+  let(:account) { Fabricate(:account) }
+
+  before do
+    allow(controller).to receive(:doorkeeper_token) { token }
+  end
+
+  describe 'POST #create' do
+    it 'returns http success' do
+      post :create, params: { account_id: account.id, limit: 2 }
+
+      expect(response).to have_http_status(200)
+    end
+  end
+end
diff --git a/spec/controllers/api/v1/admin/email_domain_blocks_controller_spec.rb b/spec/controllers/api/v1/admin/email_domain_blocks_controller_spec.rb
new file mode 100644
index 000000000..a92a29869
--- /dev/null
+++ b/spec/controllers/api/v1/admin/email_domain_blocks_controller_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+describe Api::V1::Admin::EmailDomainBlocksController do
+  render_views
+
+  let(:user)    { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
+  let(:token)   { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'admin:read') }
+  let(:account) { Fabricate(:account) }
+
+  before do
+    allow(controller).to receive(:doorkeeper_token) { token }
+  end
+
+  describe 'GET #index' do
+    it 'returns http success' do
+      get :index, params: { account_id: account.id, limit: 2 }
+
+      expect(response).to have_http_status(200)
+    end
+  end
+end
diff --git a/spec/controllers/api/v1/admin/ip_blocks_controller_spec.rb b/spec/controllers/api/v1/admin/ip_blocks_controller_spec.rb
new file mode 100644
index 000000000..50e2ae968
--- /dev/null
+++ b/spec/controllers/api/v1/admin/ip_blocks_controller_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+describe Api::V1::Admin::IpBlocksController do
+  render_views
+
+  let(:user)    { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
+  let(:token)   { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'admin:read') }
+  let(:account) { Fabricate(:account) }
+
+  before do
+    allow(controller).to receive(:doorkeeper_token) { token }
+  end
+
+  describe 'GET #index' do
+    it 'returns http success' do
+      get :index, params: { account_id: account.id, limit: 2 }
+
+      expect(response).to have_http_status(200)
+    end
+  end
+end
diff --git a/spec/controllers/api/v1/admin/measures_controller_spec.rb b/spec/controllers/api/v1/admin/measures_controller_spec.rb
new file mode 100644
index 000000000..03727a632
--- /dev/null
+++ b/spec/controllers/api/v1/admin/measures_controller_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+describe Api::V1::Admin::MeasuresController do
+  render_views
+
+  let(:user)    { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
+  let(:token)   { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'admin:read') }
+  let(:account) { Fabricate(:account) }
+
+  before do
+    allow(controller).to receive(:doorkeeper_token) { token }
+  end
+
+  describe 'POST #create' do
+    it 'returns http success' do
+      post :create, params: { account_id: account.id, limit: 2 }
+
+      expect(response).to have_http_status(200)
+    end
+  end
+end
diff --git a/spec/controllers/api/v1/admin/retention_controller_spec.rb b/spec/controllers/api/v1/admin/retention_controller_spec.rb
new file mode 100644
index 000000000..2381dbcb4
--- /dev/null
+++ b/spec/controllers/api/v1/admin/retention_controller_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+describe Api::V1::Admin::RetentionController do
+  render_views
+
+  let(:user)    { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
+  let(:token)   { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'admin:read') }
+  let(:account) { Fabricate(:account) }
+
+  before do
+    allow(controller).to receive(:doorkeeper_token) { token }
+  end
+
+  describe 'POST #create' do
+    it 'returns http success' do
+      post :create, params: { account_id: account.id, limit: 2 }
+
+      expect(response).to have_http_status(200)
+    end
+  end
+end
diff --git a/spec/controllers/api/v1/admin/trends/links_controller_spec.rb b/spec/controllers/api/v1/admin/trends/links_controller_spec.rb
new file mode 100644
index 000000000..a64292f06
--- /dev/null
+++ b/spec/controllers/api/v1/admin/trends/links_controller_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+describe Api::V1::Admin::Trends::LinksController do
+  render_views
+
+  let(:user)    { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
+  let(:token)   { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'admin:read') }
+  let(:account) { Fabricate(:account) }
+
+  before do
+    allow(controller).to receive(:doorkeeper_token) { token }
+  end
+
+  describe 'GET #index' do
+    it 'returns http success' do
+      get :index, params: { account_id: account.id, limit: 2 }
+
+      expect(response).to have_http_status(200)
+    end
+  end
+end
diff --git a/spec/controllers/api/v1/admin/trends/statuses_controller_spec.rb b/spec/controllers/api/v1/admin/trends/statuses_controller_spec.rb
new file mode 100644
index 000000000..821cc499f
--- /dev/null
+++ b/spec/controllers/api/v1/admin/trends/statuses_controller_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+describe Api::V1::Admin::Trends::StatusesController do
+  render_views
+
+  let(:user)    { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
+  let(:token)   { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'admin:read') }
+  let(:account) { Fabricate(:account) }
+
+  before do
+    allow(controller).to receive(:doorkeeper_token) { token }
+  end
+
+  describe 'GET #index' do
+    it 'returns http success' do
+      get :index, params: { account_id: account.id, limit: 2 }
+
+      expect(response).to have_http_status(200)
+    end
+  end
+end
diff --git a/spec/controllers/api/v1/admin/trends/tags_controller_spec.rb b/spec/controllers/api/v1/admin/trends/tags_controller_spec.rb
new file mode 100644
index 000000000..480306ce7
--- /dev/null
+++ b/spec/controllers/api/v1/admin/trends/tags_controller_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+describe Api::V1::Admin::Trends::TagsController do
+  render_views
+
+  let(:user)    { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
+  let(:token)   { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'admin:read') }
+  let(:account) { Fabricate(:account) }
+
+  before do
+    allow(controller).to receive(:doorkeeper_token) { token }
+  end
+
+  describe 'GET #index' do
+    it 'returns http success' do
+      get :index, params: { account_id: account.id, limit: 2 }
+
+      expect(response).to have_http_status(200)
+    end
+  end
+end