about summary refs log tree commit diff
path: root/spec/controllers/settings/exports_controller_spec.rb
diff options
context:
space:
mode:
authorpluralcafe-docker <git@plural.cafe>2018-12-17 01:28:17 +0000
committerpluralcafe-docker <git@plural.cafe>2018-12-17 01:28:17 +0000
commitf290c5e2c337bb0aab82cb23653d4ff084ba8bbe (patch)
tree65712093ee4852a04fab5160cea341cb80f91747 /spec/controllers/settings/exports_controller_spec.rb
parent87f09d3bebd2d890ecad19d360fc687f1a57f3b0 (diff)
parent396c5dea87f259255f3676bb7b30f5cfdfec9d4e (diff)
Merge branch 'glitch'
Diffstat (limited to 'spec/controllers/settings/exports_controller_spec.rb')
-rw-r--r--spec/controllers/settings/exports_controller_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/controllers/settings/exports_controller_spec.rb b/spec/controllers/settings/exports_controller_spec.rb
index b7cab4d8f..a46fe095d 100644
--- a/spec/controllers/settings/exports_controller_spec.rb
+++ b/spec/controllers/settings/exports_controller_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
 require 'rails_helper'
 
 describe Settings::ExportsController do
@@ -28,4 +30,23 @@ describe Settings::ExportsController do
       end
     end
   end
+
+  describe 'POST #create' do
+    before do
+      sign_in Fabricate(:user), scope: :user
+    end
+
+    it 'redirects to settings_export_path' do
+      post :create
+      expect(response).to redirect_to(settings_export_path)
+    end
+
+    it 'queues BackupWorker job by 1' do
+      Sidekiq::Testing.fake! do
+        expect do
+          post :create
+        end.to change(BackupWorker.jobs, :size).by(1)
+      end
+    end
+  end
 end