2014-08-10 23:50:44 +03:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2014-08-30 19:33:13 +03:00
|
|
|
RSpec.describe LecturesController, type: :controller do
|
|
|
|
let(:user) { create :user, confirmed_at: Time.now }
|
2014-08-10 23:50:44 +03:00
|
|
|
|
2014-08-30 19:33:13 +03:00
|
|
|
before do
|
|
|
|
sign_in user
|
|
|
|
end
|
|
|
|
|
2014-08-30 19:45:25 +03:00
|
|
|
describe 'GET index' do
|
|
|
|
it 'returns HTTP Success status code'
|
|
|
|
it 'assigns the lectures of the current user to @lectures'
|
|
|
|
end
|
|
|
|
|
2014-08-30 19:33:13 +03:00
|
|
|
describe 'GET new' do
|
2014-08-30 19:45:25 +03:00
|
|
|
it 'returns HTTP Success status code' do
|
2014-08-10 23:50:44 +03:00
|
|
|
get :new
|
|
|
|
expect(response).to be_success
|
|
|
|
end
|
2014-08-30 19:33:13 +03:00
|
|
|
|
|
|
|
it 'assigns a blank lecture to @lecture'
|
2014-08-10 23:50:44 +03:00
|
|
|
end
|
|
|
|
|
2014-08-30 19:33:13 +03:00
|
|
|
describe 'POST create' do
|
|
|
|
it 'assigns the new lecture to @lecture'
|
|
|
|
|
|
|
|
context 'when passed correct parameters' do
|
|
|
|
it 'creates a new lecture'
|
|
|
|
it 'redirects to the created lecture'
|
|
|
|
end
|
2014-08-10 23:50:44 +03:00
|
|
|
|
2014-08-30 19:33:13 +03:00
|
|
|
context 'when passed incorrect parameters' do
|
|
|
|
it 'renders the edit template'
|
|
|
|
it 'returns HTTP Unprocessable Entity status code'
|
2014-08-10 23:50:44 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-08-30 19:33:13 +03:00
|
|
|
describe 'GET edit' do
|
|
|
|
context 'when the lecture exists' do
|
|
|
|
it 'returns http success'
|
|
|
|
it 'assigns the lecture to @lecture'
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when the lecture does not exist' do
|
|
|
|
it 'returns HTTP Not Found status code'
|
2014-08-10 23:50:44 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-08-30 19:33:13 +03:00
|
|
|
describe 'PUT update' do
|
|
|
|
context 'when the lecture does not exist' do
|
|
|
|
it 'returns HTTP Not Found status code'
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when the lecture exists' do
|
|
|
|
it 'assigns the lecture to @lecture'
|
|
|
|
|
|
|
|
context 'when passed correct parameters' do
|
|
|
|
it 'redirects to the updated lecture'
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when passed incorrect parameters' do
|
|
|
|
it 'renders the edit template'
|
|
|
|
it 'returns HTTP Unprocessable Entity status code'
|
|
|
|
end
|
2014-08-10 23:50:44 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-08-30 19:33:13 +03:00
|
|
|
describe 'GET show' do
|
|
|
|
context 'when the lecture exists' do
|
|
|
|
it 'returns HTTP Success status code'
|
|
|
|
it 'assigns the lecture to @lecture'
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when the lecture does not exist' do
|
|
|
|
it 'returns HTTP Not Found status code'
|
2014-08-10 23:50:44 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|