Fix Rubocop offenses
This commit is contained in:
@ -9,7 +9,7 @@ describe Admin::DashboardController do
|
|||||||
describe 'with format HTML' do
|
describe 'with format HTML' do
|
||||||
before { get :show }
|
before { get :show }
|
||||||
|
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:show)
|
expect_template(:show)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ describe Admin::DashboardController do
|
|||||||
before { get :show, format: :json }
|
before { get :show, format: :json }
|
||||||
|
|
||||||
expect_json
|
expect_json
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -78,7 +78,7 @@ describe ApplicationController do
|
|||||||
describe 'GET #welcome' do
|
describe 'GET #welcome' do
|
||||||
before { get :welcome }
|
before { get :welcome }
|
||||||
|
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:welcome)
|
expect_template(:welcome)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -25,7 +25,7 @@ describe CodeOcean::FilesController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_json
|
expect_json
|
||||||
expect_status(201)
|
expect_http_status(:created)
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with an invalid file' do
|
context 'with an invalid file' do
|
||||||
@ -36,7 +36,7 @@ describe CodeOcean::FilesController do
|
|||||||
|
|
||||||
expect_assigns(file: CodeOcean::File)
|
expect_assigns(file: CodeOcean::File)
|
||||||
expect_json
|
expect_json
|
||||||
expect_status(422)
|
expect_http_status(:unprocessable_entity)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ describe CodeharborLinksController do
|
|||||||
get :new
|
get :new
|
||||||
end
|
end
|
||||||
|
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'GET #edit' do
|
describe 'GET #edit' do
|
||||||
@ -27,7 +27,7 @@ describe CodeharborLinksController do
|
|||||||
|
|
||||||
before { get :edit, params: {id: codeharbor_link.id} }
|
before { get :edit, params: {id: codeharbor_link.id} }
|
||||||
|
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'POST #create' do
|
describe 'POST #create' do
|
||||||
|
@ -27,7 +27,7 @@ describe ConsumersController do
|
|||||||
before { post :create, params: {consumer: {}} }
|
before { post :create, params: {consumer: {}} }
|
||||||
|
|
||||||
expect_assigns(consumer: Consumer)
|
expect_assigns(consumer: Consumer)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:new)
|
expect_template(:new)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -49,7 +49,7 @@ describe ConsumersController do
|
|||||||
before { get :edit, params: {id: consumer.id} }
|
before { get :edit, params: {id: consumer.id} }
|
||||||
|
|
||||||
expect_assigns(consumer: Consumer)
|
expect_assigns(consumer: Consumer)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:edit)
|
expect_template(:edit)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ describe ConsumersController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_assigns(consumers: Consumer.all)
|
expect_assigns(consumers: Consumer.all)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:index)
|
expect_template(:index)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ describe ConsumersController do
|
|||||||
before { get :new }
|
before { get :new }
|
||||||
|
|
||||||
expect_assigns(consumer: Consumer)
|
expect_assigns(consumer: Consumer)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:new)
|
expect_template(:new)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ describe ConsumersController do
|
|||||||
before { get :show, params: {id: consumer.id} }
|
before { get :show, params: {id: consumer.id} }
|
||||||
|
|
||||||
expect_assigns(consumer: :consumer)
|
expect_assigns(consumer: :consumer)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:show)
|
expect_template(:show)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ describe ConsumersController do
|
|||||||
before { put :update, params: {consumer: {name: ''}, id: consumer.id} }
|
before { put :update, params: {consumer: {name: ''}, id: consumer.id} }
|
||||||
|
|
||||||
expect_assigns(consumer: Consumer)
|
expect_assigns(consumer: Consumer)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:edit)
|
expect_template(:edit)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -10,13 +10,13 @@ describe ErrorTemplateAttributesController do
|
|||||||
|
|
||||||
it 'gets index' do
|
it 'gets index' do
|
||||||
get :index
|
get :index
|
||||||
expect(response.status).to eq(200)
|
expect(response).to have_http_status(:ok)
|
||||||
expect(assigns(:error_template_attributes)).not_to be_nil
|
expect(assigns(:error_template_attributes)).not_to be_nil
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'gets new' do
|
it 'gets new' do
|
||||||
get :new
|
get :new
|
||||||
expect(response.status).to eq(200)
|
expect(response).to have_http_status(:ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'creates error_template_attribute' do
|
it 'creates error_template_attribute' do
|
||||||
@ -26,12 +26,12 @@ describe ErrorTemplateAttributesController do
|
|||||||
|
|
||||||
it 'shows error_template_attribute' do
|
it 'shows error_template_attribute' do
|
||||||
get :show, params: {id: error_template_attribute}
|
get :show, params: {id: error_template_attribute}
|
||||||
expect(response.status).to eq(200)
|
expect(response).to have_http_status(:ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'gets edit' do
|
it 'gets edit' do
|
||||||
get :edit, params: {id: error_template_attribute}
|
get :edit, params: {id: error_template_attribute}
|
||||||
expect(response.status).to eq(200)
|
expect(response).to have_http_status(:ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'updates error_template_attribute' do
|
it 'updates error_template_attribute' do
|
||||||
|
@ -10,13 +10,13 @@ describe ErrorTemplatesController do
|
|||||||
|
|
||||||
it 'gets index' do
|
it 'gets index' do
|
||||||
get :index
|
get :index
|
||||||
expect(response.status).to eq(200)
|
expect(response).to have_http_status(:ok)
|
||||||
expect(assigns(:error_templates)).not_to be_nil
|
expect(assigns(:error_templates)).not_to be_nil
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'gets new' do
|
it 'gets new' do
|
||||||
get :new
|
get :new
|
||||||
expect(response.status).to eq(200)
|
expect(response).to have_http_status(:ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'creates error_template' do
|
it 'creates error_template' do
|
||||||
@ -26,12 +26,12 @@ describe ErrorTemplatesController do
|
|||||||
|
|
||||||
it 'shows error_template' do
|
it 'shows error_template' do
|
||||||
get :show, params: {id: error_template}
|
get :show, params: {id: error_template}
|
||||||
expect(response.status).to eq(200)
|
expect(response).to have_http_status(:ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'gets edit' do
|
it 'gets edit' do
|
||||||
get :edit, params: {id: error_template}
|
get :edit, params: {id: error_template}
|
||||||
expect(response.status).to eq(200)
|
expect(response).to have_http_status(:ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'updates error_template' do
|
it 'updates error_template' do
|
||||||
|
@ -20,20 +20,20 @@ describe EventsController do
|
|||||||
expect { perform_request.call }.to change(Event, :count).by(1)
|
expect { perform_request.call }.to change(Event, :count).by(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
expect_status(201)
|
expect_http_status(:created)
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with an invalid event' do
|
context 'with an invalid event' do
|
||||||
before { post :create, params: {event: {exercise_id: 847_482}} }
|
before { post :create, params: {event: {exercise_id: 847_482}} }
|
||||||
|
|
||||||
expect_assigns(event: Event)
|
expect_assigns(event: Event)
|
||||||
expect_status(422)
|
expect_http_status(:unprocessable_entity)
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with no event' do
|
context 'with no event' do
|
||||||
before { post :create }
|
before { post :create }
|
||||||
|
|
||||||
expect_status(422)
|
expect_http_status(:unprocessable_entity)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -46,7 +46,7 @@ describe ExecutionEnvironmentsController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_assigns(execution_environment: ExecutionEnvironment)
|
expect_assigns(execution_environment: ExecutionEnvironment)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:new)
|
expect_template(:new)
|
||||||
|
|
||||||
it 'does not register the execution environment with the runner management' do
|
it 'does not register the execution environment with the runner management' do
|
||||||
@ -82,7 +82,7 @@ describe ExecutionEnvironmentsController do
|
|||||||
|
|
||||||
expect_assigns(docker_images: Array)
|
expect_assigns(docker_images: Array)
|
||||||
expect_assigns(execution_environment: :execution_environment)
|
expect_assigns(execution_environment: :execution_environment)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:edit)
|
expect_template(:edit)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ describe ExecutionEnvironmentsController do
|
|||||||
|
|
||||||
expect_assigns(execution_environment: :execution_environment)
|
expect_assigns(execution_environment: :execution_environment)
|
||||||
expect_json
|
expect_json
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'GET #index' do
|
describe 'GET #index' do
|
||||||
@ -108,7 +108,7 @@ describe ExecutionEnvironmentsController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_assigns(execution_environments: ExecutionEnvironment.all)
|
expect_assigns(execution_environments: ExecutionEnvironment.all)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:index)
|
expect_template(:index)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ describe ExecutionEnvironmentsController do
|
|||||||
|
|
||||||
expect_assigns(docker_images: Array)
|
expect_assigns(docker_images: Array)
|
||||||
expect_assigns(execution_environment: ExecutionEnvironment)
|
expect_assigns(execution_environment: ExecutionEnvironment)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:new)
|
expect_template(:new)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ describe ExecutionEnvironmentsController do
|
|||||||
before { get :shell, params: {id: execution_environment.id} }
|
before { get :shell, params: {id: execution_environment.id} }
|
||||||
|
|
||||||
expect_assigns(execution_environment: :execution_environment)
|
expect_assigns(execution_environment: :execution_environment)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:shell)
|
expect_template(:shell)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ describe ExecutionEnvironmentsController do
|
|||||||
before { get :statistics, params: {id: execution_environment.id} }
|
before { get :statistics, params: {id: execution_environment.id} }
|
||||||
|
|
||||||
expect_assigns(execution_environment: :execution_environment)
|
expect_assigns(execution_environment: :execution_environment)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:statistics)
|
expect_template(:statistics)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ describe ExecutionEnvironmentsController do
|
|||||||
before { get :show, params: {id: execution_environment.id} }
|
before { get :show, params: {id: execution_environment.id} }
|
||||||
|
|
||||||
expect_assigns(execution_environment: :execution_environment)
|
expect_assigns(execution_environment: :execution_environment)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:show)
|
expect_template(:show)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -206,7 +206,7 @@ describe ExecutionEnvironmentsController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_assigns(execution_environment: ExecutionEnvironment)
|
expect_assigns(execution_environment: ExecutionEnvironment)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:edit)
|
expect_template(:edit)
|
||||||
|
|
||||||
it 'does not update the execution environment at the runner management' do
|
it 'does not update the execution environment at the runner management' do
|
||||||
|
@ -20,7 +20,7 @@ describe ExercisesController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_json
|
expect_json
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'POST #clone' do
|
describe 'POST #clone' do
|
||||||
@ -122,7 +122,7 @@ describe ExercisesController do
|
|||||||
before { post :create, params: {exercise: {}} }
|
before { post :create, params: {exercise: {}} }
|
||||||
|
|
||||||
expect_assigns(exercise: Exercise)
|
expect_assigns(exercise: Exercise)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:new)
|
expect_template(:new)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -144,7 +144,7 @@ describe ExercisesController do
|
|||||||
before { get :edit, params: {id: exercise.id} }
|
before { get :edit, params: {id: exercise.id} }
|
||||||
|
|
||||||
expect_assigns(exercise: :exercise)
|
expect_assigns(exercise: :exercise)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:edit)
|
expect_template(:edit)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ describe ExercisesController do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:implement)
|
expect_template(:implement)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ describe ExercisesController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_assigns(exercises: :scope)
|
expect_assigns(exercises: :scope)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:index)
|
expect_template(:index)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ describe ExercisesController do
|
|||||||
|
|
||||||
expect_assigns(execution_environments: ExecutionEnvironment.all, exercise: Exercise)
|
expect_assigns(execution_environments: ExecutionEnvironment.all, exercise: Exercise)
|
||||||
expect_assigns(exercise: Exercise)
|
expect_assigns(exercise: Exercise)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:new)
|
expect_template(:new)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ describe ExercisesController do
|
|||||||
before { get :show, params: {id: exercise.id} }
|
before { get :show, params: {id: exercise.id} }
|
||||||
|
|
||||||
expect_assigns(exercise: :exercise)
|
expect_assigns(exercise: :exercise)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:show)
|
expect_template(:show)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -223,7 +223,7 @@ describe ExercisesController do
|
|||||||
before { get :reload, format: :json, params: {id: exercise.id} }
|
before { get :reload, format: :json, params: {id: exercise.id} }
|
||||||
|
|
||||||
expect_assigns(exercise: :exercise)
|
expect_assigns(exercise: :exercise)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:reload)
|
expect_template(:reload)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -232,7 +232,7 @@ describe ExercisesController do
|
|||||||
before { get :statistics, params: {id: exercise.id} }
|
before { get :statistics, params: {id: exercise.id} }
|
||||||
|
|
||||||
expect_assigns(exercise: :exercise)
|
expect_assigns(exercise: :exercise)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:statistics)
|
expect_template(:statistics)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ describe ExercisesController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_json
|
expect_json
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when the score transmission fails' do
|
context 'when the score transmission fails' do
|
||||||
@ -301,7 +301,7 @@ describe ExercisesController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_json
|
expect_json
|
||||||
expect_status(503)
|
expect_http_status(:service_unavailable)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -322,7 +322,7 @@ describe ExercisesController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_json
|
expect_json
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -340,7 +340,7 @@ describe ExercisesController do
|
|||||||
before { put :update, params: {exercise: {title: ''}, id: exercise.id} }
|
before { put :update, params: {exercise: {title: ''}, id: exercise.id} }
|
||||||
|
|
||||||
expect_assigns(exercise: Exercise)
|
expect_assigns(exercise: Exercise)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:edit)
|
expect_template(:edit)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -12,7 +12,7 @@ describe ExternalUsersController do
|
|||||||
before { get :index }
|
before { get :index }
|
||||||
|
|
||||||
expect_assigns(users: ExternalUser.all)
|
expect_assigns(users: ExternalUser.all)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:index)
|
expect_template(:index)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ describe ExternalUsersController do
|
|||||||
before { get :show, params: {id: users.first.id} }
|
before { get :show, params: {id: users.first.id} }
|
||||||
|
|
||||||
expect_assigns(user: ExternalUser)
|
expect_assigns(user: ExternalUser)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:show)
|
expect_template(:show)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -29,7 +29,7 @@ describe FileTypesController do
|
|||||||
|
|
||||||
expect_assigns(editor_modes: Array)
|
expect_assigns(editor_modes: Array)
|
||||||
expect_assigns(file_type: FileType)
|
expect_assigns(file_type: FileType)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:new)
|
expect_template(:new)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -52,7 +52,7 @@ describe FileTypesController do
|
|||||||
|
|
||||||
expect_assigns(editor_modes: Array)
|
expect_assigns(editor_modes: Array)
|
||||||
expect_assigns(file_type: FileType)
|
expect_assigns(file_type: FileType)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:edit)
|
expect_template(:edit)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ describe FileTypesController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_assigns(file_types: FileType.all)
|
expect_assigns(file_types: FileType.all)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:index)
|
expect_template(:index)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ describe FileTypesController do
|
|||||||
|
|
||||||
expect_assigns(editor_modes: Array)
|
expect_assigns(editor_modes: Array)
|
||||||
expect_assigns(file_type: FileType)
|
expect_assigns(file_type: FileType)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:new)
|
expect_template(:new)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ describe FileTypesController do
|
|||||||
before { get :show, params: {id: file_type.id} }
|
before { get :show, params: {id: file_type.id} }
|
||||||
|
|
||||||
expect_assigns(file_type: :file_type)
|
expect_assigns(file_type: :file_type)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:show)
|
expect_template(:show)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ describe FileTypesController do
|
|||||||
|
|
||||||
expect_assigns(editor_modes: Array)
|
expect_assigns(editor_modes: Array)
|
||||||
expect_assigns(file_type: FileType)
|
expect_assigns(file_type: FileType)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:edit)
|
expect_template(:edit)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -33,7 +33,7 @@ describe InternalUsersController do
|
|||||||
before { get :activate, params: {id: user.id, token: user.activation_token} }
|
before { get :activate, params: {id: user.id, token: user.activation_token} }
|
||||||
|
|
||||||
expect_assigns(user: InternalUser)
|
expect_assigns(user: InternalUser)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:activate)
|
expect_template(:activate)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -138,7 +138,7 @@ describe InternalUsersController do
|
|||||||
before { post :create, params: {internal_user: {}} }
|
before { post :create, params: {internal_user: {}} }
|
||||||
|
|
||||||
expect_assigns(user: InternalUser)
|
expect_assigns(user: InternalUser)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:new)
|
expect_template(:new)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -165,7 +165,7 @@ describe InternalUsersController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_assigns(user: InternalUser)
|
expect_assigns(user: InternalUser)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:edit)
|
expect_template(:edit)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ describe InternalUsersController do
|
|||||||
get :forgot_password
|
get :forgot_password
|
||||||
end
|
end
|
||||||
|
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:forgot_password)
|
expect_template(:forgot_password)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ describe InternalUsersController do
|
|||||||
context 'without an email address' do
|
context 'without an email address' do
|
||||||
before { post :forgot_password }
|
before { post :forgot_password }
|
||||||
|
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:forgot_password)
|
expect_template(:forgot_password)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -225,7 +225,7 @@ describe InternalUsersController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_assigns(users: InternalUser.all)
|
expect_assigns(users: InternalUser.all)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:index)
|
expect_template(:index)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ describe InternalUsersController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_assigns(user: InternalUser)
|
expect_assigns(user: InternalUser)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:new)
|
expect_template(:new)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -256,7 +256,7 @@ describe InternalUsersController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_assigns(user: :user)
|
expect_assigns(user: :user)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:reset_password)
|
expect_template(:reset_password)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -295,7 +295,7 @@ describe InternalUsersController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_assigns(user: :user)
|
expect_assigns(user: :user)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:reset_password)
|
expect_template(:reset_password)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -308,7 +308,7 @@ describe InternalUsersController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_assigns(user: InternalUser)
|
expect_assigns(user: InternalUser)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:show)
|
expect_template(:show)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -326,7 +326,7 @@ describe InternalUsersController do
|
|||||||
before { put :update, params: {internal_user: {email: ''}, id: users.first.id} }
|
before { put :update, params: {internal_user: {email: ''}, id: users.first.id} }
|
||||||
|
|
||||||
expect_assigns(user: InternalUser)
|
expect_assigns(user: InternalUser)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:edit)
|
expect_template(:edit)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -35,14 +35,14 @@ describe RequestForCommentsController do
|
|||||||
describe 'GET #my_comment_requests' do
|
describe 'GET #my_comment_requests' do
|
||||||
before { get :my_comment_requests }
|
before { get :my_comment_requests }
|
||||||
|
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:index)
|
expect_template(:index)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'GET #rfcs_with_my_comments' do
|
describe 'GET #rfcs_with_my_comments' do
|
||||||
before { get :rfcs_with_my_comments }
|
before { get :rfcs_with_my_comments }
|
||||||
|
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:index)
|
expect_template(:index)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ describe RequestForCommentsController do
|
|||||||
get :rfcs_for_exercise, params: {exercise_id: exercise.id}
|
get :rfcs_for_exercise, params: {exercise_id: exercise.id}
|
||||||
end
|
end
|
||||||
|
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:index)
|
expect_template(:index)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -217,7 +217,7 @@ describe SessionsController do
|
|||||||
perform_request.call
|
perform_request.call
|
||||||
end
|
end
|
||||||
|
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:destroy_through_lti)
|
expect_template(:destroy_through_lti)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -230,7 +230,7 @@ describe SessionsController do
|
|||||||
get :new
|
get :new
|
||||||
end
|
end
|
||||||
|
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:new)
|
expect_template(:new)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ describe StatisticsController do
|
|||||||
describe "GET ##{route}" do
|
describe "GET ##{route}" do
|
||||||
before { get route }
|
before { get route }
|
||||||
|
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(route)
|
expect_template(route)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -20,7 +20,7 @@ describe StatisticsController do
|
|||||||
describe "GET ##{route}" do
|
describe "GET ##{route}" do
|
||||||
before { get route }
|
before { get route }
|
||||||
|
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:activity_history)
|
expect_template(:activity_history)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -29,7 +29,7 @@ describe StatisticsController do
|
|||||||
describe "GET ##{route}.json" do
|
describe "GET ##{route}.json" do
|
||||||
before { get route, format: :json }
|
before { get route, format: :json }
|
||||||
|
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_json
|
expect_json
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -26,7 +26,7 @@ describe SubmissionsController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_json
|
expect_json
|
||||||
expect_status(201)
|
expect_http_status(:created)
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with an invalid submission' do
|
context 'with an invalid submission' do
|
||||||
@ -34,7 +34,7 @@ describe SubmissionsController do
|
|||||||
|
|
||||||
expect_assigns(submission: Submission)
|
expect_assigns(submission: Submission)
|
||||||
expect_json
|
expect_json
|
||||||
expect_status(422)
|
expect_http_status(:unprocessable_entity)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ describe SubmissionsController do
|
|||||||
context 'with an invalid filename' do
|
context 'with an invalid filename' do
|
||||||
before { get :download_file, params: {filename: SecureRandom.hex, id: submission.id} }
|
before { get :download_file, params: {filename: SecureRandom.hex, id: submission.id} }
|
||||||
|
|
||||||
expect_status(404)
|
expect_http_status(:not_found)
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with a valid binary filename' do
|
context 'with a valid binary filename' do
|
||||||
@ -56,7 +56,7 @@ describe SubmissionsController do
|
|||||||
expect_assigns(file: :file)
|
expect_assigns(file: :file)
|
||||||
expect_assigns(submission: :submission)
|
expect_assigns(submission: :submission)
|
||||||
expect_content_type('application/octet-stream')
|
expect_content_type('application/octet-stream')
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
|
|
||||||
it 'sets the correct filename' do
|
it 'sets the correct filename' do
|
||||||
expect(response.headers['Content-Disposition']).to include("attachment; filename=\"#{file.name_with_extension}\"")
|
expect(response.headers['Content-Disposition']).to include("attachment; filename=\"#{file.name_with_extension}\"")
|
||||||
@ -75,7 +75,7 @@ describe SubmissionsController do
|
|||||||
expect_assigns(file: :file)
|
expect_assigns(file: :file)
|
||||||
expect_assigns(submission: :submission)
|
expect_assigns(submission: :submission)
|
||||||
expect_content_type('video/mp4')
|
expect_content_type('video/mp4')
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
|
|
||||||
it 'sets the correct filename' do
|
it 'sets the correct filename' do
|
||||||
expect(response.headers['Content-Disposition']).to include("attachment; filename=\"#{file.name_with_extension}\"")
|
expect(response.headers['Content-Disposition']).to include("attachment; filename=\"#{file.name_with_extension}\"")
|
||||||
@ -88,7 +88,7 @@ describe SubmissionsController do
|
|||||||
expect_assigns(file: :file)
|
expect_assigns(file: :file)
|
||||||
expect_assigns(submission: :submission)
|
expect_assigns(submission: :submission)
|
||||||
expect_content_type('text/javascript')
|
expect_content_type('text/javascript')
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
|
|
||||||
it 'sets the correct filename' do
|
it 'sets the correct filename' do
|
||||||
expect(response.headers['Content-Disposition']).to include("attachment; filename=\"#{file.name_with_extension}\"")
|
expect(response.headers['Content-Disposition']).to include("attachment; filename=\"#{file.name_with_extension}\"")
|
||||||
@ -104,7 +104,7 @@ describe SubmissionsController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
expect_assigns(submissions: Submission.all)
|
expect_assigns(submissions: Submission.all)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:index)
|
expect_template(:index)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ describe SubmissionsController do
|
|||||||
context 'with an invalid filename' do
|
context 'with an invalid filename' do
|
||||||
before { get :render_file, params: {filename: SecureRandom.hex, id: submission.id} }
|
before { get :render_file, params: {filename: SecureRandom.hex, id: submission.id} }
|
||||||
|
|
||||||
expect_status(404)
|
expect_http_status(:not_found)
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with a valid filename' do
|
context 'with a valid filename' do
|
||||||
@ -128,7 +128,7 @@ describe SubmissionsController do
|
|||||||
expect_assigns(file: :file)
|
expect_assigns(file: :file)
|
||||||
expect_assigns(submission: :submission)
|
expect_assigns(submission: :submission)
|
||||||
expect_content_type('video/mp4')
|
expect_content_type('video/mp4')
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
|
|
||||||
it 'renders the file content' do
|
it 'renders the file content' do
|
||||||
expect(response.body).to eq(file.native_file.read)
|
expect(response.body).to eq(file.native_file.read)
|
||||||
@ -141,7 +141,7 @@ describe SubmissionsController do
|
|||||||
expect_assigns(file: :file)
|
expect_assigns(file: :file)
|
||||||
expect_assigns(submission: :submission)
|
expect_assigns(submission: :submission)
|
||||||
expect_content_type('text/javascript')
|
expect_content_type('text/javascript')
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
|
|
||||||
it 'renders the file content' do
|
it 'renders the file content' do
|
||||||
expect(response.body).to eq(file.content)
|
expect(response.body).to eq(file.content)
|
||||||
@ -167,7 +167,7 @@ describe SubmissionsController do
|
|||||||
before { get :show, params: {id: submission.id} }
|
before { get :show, params: {id: submission.id} }
|
||||||
|
|
||||||
expect_assigns(submission: :submission)
|
expect_assigns(submission: :submission)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
expect_template(:show)
|
expect_template(:show)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ describe SubmissionsController do
|
|||||||
before { get :show, params: {id: submission.id}, format: :json }
|
before { get :show, params: {id: submission.id}, format: :json }
|
||||||
|
|
||||||
expect_assigns(submission: :submission)
|
expect_assigns(submission: :submission)
|
||||||
expect_status(200)
|
expect_http_status(:ok)
|
||||||
|
|
||||||
%i[render run test].each do |action|
|
%i[render run test].each do |action|
|
||||||
describe "##{action}_url" do
|
describe "##{action}_url" do
|
||||||
|
@ -49,9 +49,9 @@ def expect_redirect(path = nil)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def expect_status(status)
|
def expect_http_status(status)
|
||||||
it "responds with status #{status}" do
|
it "responds with status #{status}" do
|
||||||
expect(response.status).to eq(status)
|
expect(response).to have_http_status(status)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user