This commit is contained in:
Stella Rouzi 2015-10-17 16:57:48 +03:00
parent 2e692f7ea5
commit 01086813af
37 changed files with 221 additions and 190 deletions

View file

@ -57,7 +57,7 @@ describe Admin::ConferenceController do
short_title: nil)
conference.reload
expect(flash[:alert]).
expect(flash[:error]).
to eq("Updating conference failed. Short title can't be blank.")
expect(conference.title).to eq('The dog and pony show')
expect(conference.short_title).to eq("#{conference.short_title}")
@ -68,7 +68,7 @@ describe Admin::ConferenceController do
attributes_for(:conference, title: 'Example Con',
short_title: nil)
expect(flash[:alert]).
expect(flash[:error]).
to eq("Updating conference failed. Short title can't be blank.")
expect(response).to redirect_to edit_admin_conference_path(
conference.short_title)

View file

@ -35,7 +35,6 @@ feature Ticket do
fill_in 'ticket_price', with: '-1'
click_button 'Create Ticket'
expect(flash).to eq("Creating Ticket failed: Title can't be blank. Price cents must be greater than 0.")
expect(Ticket.count).to eq(0)
end
@ -70,7 +69,6 @@ feature Ticket do
ticket.reload
expect(ticket.price).to eq(100)
expect(ticket.title).to eq('Business Ticket')
expect(flash).to eq("Ticket update failed: Title can't be blank. Price cents must be greater than 0.")
expect(Ticket.count).to eq(1)
end

View file

@ -22,11 +22,7 @@ describe Ticket do
should validate_presence_of(:price_currency)
end
it 'is not valid with a price_cents equals zero' do
should_not allow_value(0).for(:price_cents)
end
it 'is not valid with a price_cents smaller than zero' do
it 'is not valid with a price_cents less than zero' do
should_not allow_value(-1).for(:price_cents)
end