Program component for splash page

This commit is contained in:
Gopesh Tulsyan 2014-05-21 15:42:30 +05:30
parent a33e930111
commit d0fd21bfc2
18 changed files with 118 additions and 11 deletions

View file

@ -1,9 +1,10 @@
require 'spec_helper'
describe ConferenceController do
let(:conference) { create(:conference_with_registration) }
describe 'GET #show' do
it 'returns http success' do
get :show, id: 'sample'
get :show, id: conference.short_title
expect(response).to be_success
end
end

View file

@ -6,8 +6,19 @@ FactoryGirl.define do
sequence(:short_title) { |n| "dps#{n}14" }
social_tag 'dps14'
timezone 'Amsterdam'
description 'Lorem Ipsum dolsum'
contact_email 'admin@example.com'
start_date Date.today
end_date Date.tomorrow
factory :conference_with_registration do
after(:build) do |conference|
create(:participant_role)
create(:admin_role)
user = build(:user)
conference.registrations << build(:registration,
conference: conference,
person: user.person)
end
end
end
end

9
spec/factories/person.rb Normal file
View file

@ -0,0 +1,9 @@
FactoryGirl.define do
factory :person do
first_name 'Example first_name'
last_name 'Example last_name'
sequence(:email) { |n| "example#{n}@example.com" }
featured true
user
end
end

View file

@ -0,0 +1,6 @@
FactoryGirl.define do
factory :registration do
person
conference
end
end

View file

@ -2,7 +2,7 @@
FactoryGirl.define do
factory :user do
email 'example@example.com'
sequence(:email) { |n| "example#{n}@example.com" }
password 'changeme'
password_confirmation 'changeme'
confirmed_at Time.now

View file

@ -16,7 +16,7 @@ feature Conference do
fill_in 'conference_title', with: 'Example Con'
fill_in 'conference_short_title', with: 'ExCon'
fill_in 'conference_social_tag', with: 'ExCon'
fill_in 'conference_description', with: 'ExCon description'
select('(GMT+01:00) Berlin', from: 'conference[timezone]')
today = Date.today - 1

View file

@ -1,10 +1,10 @@
require 'spec_helper'
describe 'conference/show.html.haml' do
it 'renders conference details' do
@conference = create(:conference)
@conference = create(:conference, description: 'Lorem Ipsum dolsum')
assign :conference, @conference
render
expect(render).to include("#{@conference.title}")
expect(render).to include("#{@conference.description}")
end
end