mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 11:44:02 +00:00
test: drop redundant controller spec
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
This commit is contained in:
parent
f66eb8393c
commit
4c19375c6a
1 changed files with 0 additions and 59 deletions
|
|
@ -1,59 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe CommercialsController do
|
|
||||||
let(:conference) { create(:conference) }
|
|
||||||
let(:event) { create(:event, program: conference.program) }
|
|
||||||
let(:commercial_params) do
|
|
||||||
{
|
|
||||||
conference_id: conference.short_title,
|
|
||||||
proposal_id: event.id,
|
|
||||||
commercial: { url: 'https://www.youtube.com/watch?v=M9bq_alk-sw' }
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'POST #create' do
|
|
||||||
context 'when user is organizer of conference' do
|
|
||||||
let(:user) { create(:organizer, resource: conference) }
|
|
||||||
|
|
||||||
before do
|
|
||||||
sign_in user
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'creates a commercial for the event' do
|
|
||||||
expect do
|
|
||||||
post :create, params: commercial_params
|
|
||||||
end.to change(Commercial, :count).by(1)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'redirects to proposal edit page' do
|
|
||||||
post :create, params: commercial_params
|
|
||||||
|
|
||||||
expect(response).to redirect_to(edit_conference_program_proposal_path(conference.short_title, event.id, anchor: 'commercials-content'))
|
|
||||||
expect(flash[:notice]).to eq('Commercial was successfully created.')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when user is on cfp team of conference' do
|
|
||||||
let(:user) { create(:cfp_user, resource: conference) }
|
|
||||||
|
|
||||||
before do
|
|
||||||
sign_in user
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'creates a commercial for the event' do
|
|
||||||
expect do
|
|
||||||
post :create, params: commercial_params
|
|
||||||
end.to change(Commercial, :count).by(1)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'redirects to proposal edit page' do
|
|
||||||
post :create, params: commercial_params
|
|
||||||
|
|
||||||
expect(response).to redirect_to(edit_conference_program_proposal_path(conference.short_title, event.id, anchor: 'commercials-content'))
|
|
||||||
expect(flash[:notice]).to eq('Commercial was successfully created.')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue