Sha256: 83475dab6ccc7201c9433d7f87bb3aba680727444c3c7ab10a266dbf90802557
Contents?: true
Size: 989 Bytes
Versions: 22
Compression:
Stored size: 989 Bytes
Contents
require 'rails_helper' describe Kuroko2::JobSchedulesController do routes { Kuroko2::Engine.routes } before { sign_in } let(:schedules) { create_list(:job_schedule, 1) } let(:definition) { create(:job_definition, job_schedules: schedules) } describe '#index' do it do get :index, params: { job_definition_id: definition.id } expect(response).to have_http_status(:ok) expect(assigns(:schedule)).to be_new_record expect(assigns(:schedules)).to eq schedules end end describe '#create' do it do post :create, params: { job_definition_id: definition.id, job_schedule: { cron: '* * * * *' } } expect(response).to have_http_status(:created) end end describe '#destroy' do it do delete :destroy, params: { job_definition_id: definition.id, id: schedules.first.id } definition.reload expect(response).to have_http_status(:ok) expect(definition.job_schedules.size).to be 0 end end end
Version data entries
22 entries across 22 versions & 1 rubygems