Moves conference show #action to #edit action

This commit is contained in:
Chrisbr 2014-05-23 13:01:23 +02:00
parent 89fb059aaa
commit ab4d3021a2
9 changed files with 80 additions and 42 deletions

View file

@ -36,7 +36,7 @@ describe Admin::ConferenceController do
patch :update, id: conference.short_title, conference:
attributes_for(:conference, title: 'Example Con')
conference.reload
expect(response).to redirect_to admin_conference_path(
expect(response).to redirect_to edit_admin_conference_path(
conference.short_title)
end
end
@ -61,7 +61,7 @@ describe Admin::ConferenceController do
expect(flash[:alert]).
to eq("Updating conference failed. Short title can't be blank.")
expect(response).to redirect_to admin_conference_path(
expect(response).to redirect_to edit_admin_conference_path(
conference.short_title)
end
end
@ -120,6 +120,18 @@ describe Admin::ConferenceController do
end
end
describe 'GET #edit' do
it 'assigns the requested conference to conference' do
get :show, id: conference.short_title
expect(assigns(:conference)).to eq conference
end
it 'renders the show template' do
get :show, id: conference.short_title
expect(response).to render_template :show
end
end
describe 'GET #show' do
it 'assigns the requested conference to conference' do
get :show, id: conference.short_title

View file

@ -39,7 +39,7 @@ feature Conference do
expected_count = Conference.count
sign_in create(user)
visit admin_conference_path(conference.short_title)
visit edit_admin_conference_path(conference.short_title)
fill_in 'conference_title', with: 'New Con'
fill_in 'conference_short_title', with: 'NewCon'
fill_in 'conference_social_tag', with: 'NewCon'

View file

@ -0,0 +1,12 @@
require 'spec_helper'
describe 'admin/conference/edit' do
it 'renders conference details which are editable' do
@conference = create(:conference, title: 'OpenSUSE')
assign :conference, @conference
render template: 'admin/conference/edit.html.haml'
expect(rendered).to include('OpenSUSE')
expect(rendered).to include("#{@conference.contact_email}")
end
end

View file

@ -2,11 +2,10 @@ require 'spec_helper'
describe 'admin/conference/show' do
it 'renders conference details which are editable' do
it 'renders conference dashboard' do
@conference = create(:conference, title: 'OpenSUSE')
assign :conference, @conference
render
expect(rendered).to include('OpenSUSE')
expect(rendered).to include("#{@conference.contact_email}")
expect(rendered).to include("Dashboard for #{@conference.title}")
end
end