mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-01-31 15:39:11 +01:00
Add tests for ExportController#create
This commit is contained in:
parent
58d91c9c46
commit
a65232f975
1 changed files with 20 additions and 0 deletions
|
@ -17,4 +17,24 @@ describe Settings::ExportController, type: :controller do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#create" do
|
||||||
|
subject { post :create }
|
||||||
|
|
||||||
|
context "user signed in" do
|
||||||
|
let(:user) { FactoryBot.create(:user) }
|
||||||
|
|
||||||
|
before { sign_in user }
|
||||||
|
|
||||||
|
it "enqueues an ExportWorker job" do
|
||||||
|
subject
|
||||||
|
expect(ExportWorker).to have_enqueued_sidekiq_job(user.id)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "redirects to the export page" do
|
||||||
|
subject
|
||||||
|
expect(response).to redirect_to(:settings_export)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue