mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
spec/tickets: add tests for free ticket creation
This commit is contained in:
parent
4dcfc55418
commit
b2f75dd907
2 changed files with 6 additions and 6 deletions
|
|
@ -35,7 +35,7 @@ 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(flash).to eq("Creating Ticket failed: Title can't be blank. Price cents must be greater than or equal to 0.")
|
||||
expect(Ticket.count).to eq(0)
|
||||
end
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ feature Ticket do
|
|||
# It's necessary to multiply by 100 because the price is in cents
|
||||
expect(ticket.price).to eq(Money.new(100 * 100, 'USD'))
|
||||
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(flash).to eq("Ticket update failed: Title can't be blank. Price cents must be greater than or equal to 0.")
|
||||
expect(Ticket.count).to eq(1)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -22,14 +22,14 @@ 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
|
||||
should_not allow_value(-1).for(:price_cents)
|
||||
end
|
||||
|
||||
it 'is valid with a price_cents equals zero' do
|
||||
should allow_value(0).for(:price_cents)
|
||||
end
|
||||
|
||||
it 'is valid with a price_cents greater than zero' do
|
||||
should allow_value(1).for(:price_cents)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue