mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Update test just a bit
This commit is contained in:
parent
9316fe618c
commit
dde76fd41f
2 changed files with 11 additions and 10 deletions
|
|
@ -37,14 +37,14 @@ RSpec.describe '/exports', type: :request do
|
|||
before { sign_in user }
|
||||
|
||||
context 'with valid parameters' do
|
||||
let(:points) { create_list(:point, 10, user: user, timestamp: 1.day.ago) }
|
||||
let(:points) { create_list(:point, 10, user:, timestamp: 1.day.ago) }
|
||||
|
||||
it 'creates a new Export' do
|
||||
expect { post exports_url, params: params }.to change(Export, :count).by(1)
|
||||
expect { post exports_url, params: }.to change(Export, :count).by(1)
|
||||
end
|
||||
|
||||
it 'redirects to the exports index page' do
|
||||
post exports_url, params: params
|
||||
post(exports_url, params:)
|
||||
|
||||
expect(response).to redirect_to(exports_url)
|
||||
end
|
||||
|
|
@ -52,7 +52,7 @@ RSpec.describe '/exports', type: :request do
|
|||
it 'enqeuues a job to process the export' do
|
||||
ActiveJob::Base.queue_adapter = :test
|
||||
|
||||
expect { post exports_url, params: params }.to have_enqueued_job(ExportJob)
|
||||
expect { post exports_url, params: }.to have_enqueued_job(ExportJob)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -60,11 +60,11 @@ RSpec.describe '/exports', type: :request do
|
|||
let(:params) { { start_at: nil, end_at: nil } }
|
||||
|
||||
it 'does not create a new Export' do
|
||||
expect { post exports_url, params: params }.to change(Export, :count).by(0)
|
||||
expect { post exports_url, params: }.to change(Export, :count).by(0)
|
||||
end
|
||||
|
||||
it 'renders a response with 422 status (i.e. to display the "new" template)' do
|
||||
post exports_url, params: params
|
||||
post(exports_url, params:)
|
||||
|
||||
expect(response).to have_http_status(:unprocessable_entity)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -10,9 +10,10 @@ RSpec.describe 'Map', type: :request do
|
|||
|
||||
describe 'GET /index' do
|
||||
context 'when user signed in' do
|
||||
before do
|
||||
sign_in create(:user)
|
||||
end
|
||||
let(:user) { create(:user) }
|
||||
let(:points) { create_list(:point, 10, user:, timestamp: 1.day.ago) }
|
||||
|
||||
before { sign_in user }
|
||||
|
||||
it 'returns http success' do
|
||||
get map_path
|
||||
|
|
@ -22,7 +23,7 @@ RSpec.describe 'Map', type: :request do
|
|||
end
|
||||
|
||||
context 'when user not signed in' do
|
||||
it 'returns http success' do
|
||||
it 'returns redirects to sign in page' do
|
||||
get map_path
|
||||
|
||||
expect(response).to have_http_status(302)
|
||||
|
|
|
|||
Loading…
Reference in a new issue