Registration Component

This commit is contained in:
Gopesh Tulsyan 2014-05-23 21:21:11 +05:30
parent 643b8b173a
commit 5c9e0a279e
19 changed files with 172 additions and 36 deletions

View file

@ -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

View file

@ -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'

View file

@ -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