Registration Component
This commit is contained in:
parent
643b8b173a
commit
5c9e0a279e
19 changed files with 172 additions and 36 deletions
|
|
@ -2,6 +2,8 @@ FactoryGirl.define do
|
|||
factory :supporter_level do
|
||||
title 'Example Supporter Level'
|
||||
url 'www.example.com'
|
||||
amount '2200'
|
||||
price_currency 'USD'
|
||||
conference
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,15 @@ feature SupporterLevel do
|
|||
page.
|
||||
find('div.nested-fields:nth-of-type(1) div:nth-of-type(2) input').
|
||||
set('http://www.google.de')
|
||||
|
||||
page.
|
||||
find('div.nested-fields:nth-of-type(1) div:nth-of-type(3) select').
|
||||
set('USD')
|
||||
page.
|
||||
find('div.nested-fields:nth-of-type(1) div:nth-of-type(4) input').
|
||||
set('223.0')
|
||||
page.
|
||||
find('div.nested-fields:nth-of-type(1) div:nth-of-type(5) textarea').
|
||||
set('Lorem Ipsum')
|
||||
click_button 'Update Conference'
|
||||
|
||||
# Validations
|
||||
|
|
@ -33,6 +41,12 @@ feature SupporterLevel do
|
|||
value).to eq('Example supporter level')
|
||||
expect(find('div.nested-fields:nth-of-type(1) div:nth-of-type(2) input').
|
||||
value).to eq('http://www.google.de')
|
||||
expect(find('div.nested-fields:nth-of-type(1) div:nth-of-type(3) select').
|
||||
value).to eq('USD')
|
||||
expect(find('div.nested-fields:nth-of-type(1) div:nth-of-type(4) input').
|
||||
value).to eq('223.0')
|
||||
expect(find('div.nested-fields:nth-of-type(1) div:nth-of-type(5) textarea').
|
||||
value).to eq('Lorem Ipsum')
|
||||
|
||||
# Remove supporter level
|
||||
click_link 'Remove supporter_level'
|
||||
|
|
|
|||
|
|
@ -2,9 +2,16 @@ require 'spec_helper'
|
|||
describe 'conference/show.html.haml' do
|
||||
it 'renders conference details' do
|
||||
@conference = create(:conference)
|
||||
@conference.registration_description = 'Lorem Ipsum'
|
||||
@conference.registration_start_date = Date.today
|
||||
@conference.registration_end_date = Date.today + 7.days
|
||||
@conference.use_supporter_levels = true
|
||||
@conference.save!
|
||||
@conference.supporter_levels = [create(:supporter_level)]
|
||||
assign :conference, @conference
|
||||
render
|
||||
expect(render).to include("#{@conference.title}")
|
||||
expect(render).to include("#{ @conference.registration_description }")
|
||||
expect(render).to include('Example Supporter Level')
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue