From d1e9bd06a644f8b2dfd92e08ed55579fdde560e0 Mon Sep 17 00:00:00 2001 From: Gopesh Tulsyan Date: Mon, 19 May 2014 12:24:48 +0530 Subject: [PATCH] View specs, added factories, fixed bugs --- app/models/vposition.rb | 2 +- app/views/admin/conference/show.html.haml | 2 +- app/views/admin/eventtypes/index.html.haml | 2 +- .../_social_event_fields.html.erb | 1 + app/views/layouts/_navigation.html.haml | 2 +- .../conferences_controller_spec.rb | 11 +++---- spec/factories/conferences.rb | 2 +- spec/factories/difficulty_levels.rb | 8 +++++ spec/factories/email_settings.rb | 4 ++- .../{event_type.rb => event_types.rb} | 1 + spec/factories/rooms.rb | 7 +++++ spec/factories/social_events.rb | 8 +++++ spec/factories/supporter_levels.rb | 7 +++++ spec/factories/tracks.rb | 8 +++++ spec/factories/vdays.rb | 7 +++++ spec/factories/vpositions.rb | 11 +++++++ spec/spec_helper.rb | 4 +++ spec/support/sidebar.rb | 9 ++++++ .../callforpapers/show.html.haml_spec.rb | 18 +++++++++++ .../admin/conference/index.html.haml_spec.rb | 11 +++++++ .../admin/conference/new.html.haml_spec.rb | 12 +++++++ .../admin/conference/show.html.haml_spec.rb | 14 +++++++++ .../difficulty_levels/index.html.haml_spec.rb | 15 +++++++++ .../admin/emails/index.html.haml_spec.rb | 23 ++++++++++++++ .../admin/eventtypes/index.html.haml_spec.rb | 17 ++++++++++ .../views/admin/rooms/index.html.haml_spec.rb | 14 +++++++++ .../social_events/index.html.haml_spec.rb | 17 ++++++++++ .../supporter_levels/index.html.haml_spec.rb | 14 +++++++++ .../admin/tracks/index.html.haml_spec.rb | 15 +++++++++ .../admin/venue/venue_info.html.haml_spec.rb | 20 ++++++++++++ .../admin/volunteers/index.html.haml_spec.rb | 31 +++++++++++++++++++ .../admin/volunteers/show.html.haml_spec.rb | 5 +++ spec/views/home/index.html.haml_spec.rb | 9 ++++++ 33 files changed, 319 insertions(+), 12 deletions(-) create mode 100644 spec/factories/difficulty_levels.rb rename spec/factories/{event_type.rb => event_types.rb} (93%) create mode 100644 spec/factories/rooms.rb create mode 100644 spec/factories/social_events.rb create mode 100644 spec/factories/supporter_levels.rb create mode 100644 spec/factories/tracks.rb create mode 100644 spec/factories/vdays.rb create mode 100644 spec/factories/vpositions.rb create mode 100644 spec/support/sidebar.rb create mode 100644 spec/views/admin/callforpapers/show.html.haml_spec.rb create mode 100644 spec/views/admin/conference/index.html.haml_spec.rb create mode 100644 spec/views/admin/conference/new.html.haml_spec.rb create mode 100644 spec/views/admin/conference/show.html.haml_spec.rb create mode 100644 spec/views/admin/difficulty_levels/index.html.haml_spec.rb create mode 100644 spec/views/admin/emails/index.html.haml_spec.rb create mode 100644 spec/views/admin/eventtypes/index.html.haml_spec.rb create mode 100644 spec/views/admin/rooms/index.html.haml_spec.rb create mode 100644 spec/views/admin/social_events/index.html.haml_spec.rb create mode 100644 spec/views/admin/supporter_levels/index.html.haml_spec.rb create mode 100644 spec/views/admin/tracks/index.html.haml_spec.rb create mode 100644 spec/views/admin/venue/venue_info.html.haml_spec.rb create mode 100644 spec/views/admin/volunteers/index.html.haml_spec.rb create mode 100644 spec/views/admin/volunteers/show.html.haml_spec.rb create mode 100644 spec/views/home/index.html.haml_spec.rb diff --git a/app/models/vposition.rb b/app/models/vposition.rb index 9e6d5547..308f94ff 100644 --- a/app/models/vposition.rb +++ b/app/models/vposition.rb @@ -1,5 +1,5 @@ class Vposition < ActiveRecord::Base - attr_accessible :title, :description, :date, :vday_ids + attr_accessible :title, :description, :vday_ids belongs_to :conference diff --git a/app/views/admin/conference/show.html.haml b/app/views/admin/conference/show.html.haml index 334a6bd8..b246ac10 100644 --- a/app/views/admin/conference/show.html.haml +++ b/app/views/admin/conference/show.html.haml @@ -1,6 +1,6 @@ .row .col-md-3 - = render 'admin/conference/sidebar' + = render :partial => "sidebar" .col-md-9 = semantic_form_for(@conference, :url => admin_conference_path(@conference.short_title),:html => {:multipart => true}) do |f| = f.input :title, :hint => "The full name of the conference, such as 'OpenSUSE Conference 2013'" diff --git a/app/views/admin/eventtypes/index.html.haml b/app/views/admin/eventtypes/index.html.haml index 85015d41..ecbe663c 100644 --- a/app/views/admin/eventtypes/index.html.haml +++ b/app/views/admin/eventtypes/index.html.haml @@ -2,6 +2,6 @@ .col-md-3 = render 'admin/conference/sidebar' .col-md-9 - = semantic_form_for(@conference, url: admin_conference_eventtypes_path) do |f| + = semantic_form_for(@conference, url: admin_conference_eventtypes_path(@conference.short_title, @conference.event_types)) do |f| = dynamic_association :event_types, "Event Types", f = f.action :submit, :as => :button, :button_html => {:class => "btn btn-primary"} diff --git a/app/views/admin/social_events/_social_event_fields.html.erb b/app/views/admin/social_events/_social_event_fields.html.erb index 540aa4a8..e7d995b7 100644 --- a/app/views/admin/social_events/_social_event_fields.html.erb +++ b/app/views/admin/social_events/_social_event_fields.html.erb @@ -2,6 +2,7 @@ <%= f.inputs do %> <%= f.input :title %> <%= f.input :description, :input_html => {:rows => 5} %> + <%= f.date_select :date, as: :string %> <%= remove_association_link :social_event, f %> <% end %> diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml index b6c4853f..f11e5851 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -21,7 +21,7 @@ = render 'layouts/admin_menu' %ul.nav.navbar-nav.navbar-right %li.dropdown - %a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#"} + %a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#", id: "current-user-detail"} - if not current_user.person.public_name.empty? #{current_user.person.public_name} -else diff --git a/spec/controllers/conferences_controller_spec.rb b/spec/controllers/conferences_controller_spec.rb index 56a36cfe..1991d121 100644 --- a/spec/controllers/conferences_controller_spec.rb +++ b/spec/controllers/conferences_controller_spec.rb @@ -35,7 +35,7 @@ describe Admin::ConferenceController do it 'redirects to the updated conference' do patch :update, id: conference.short_title, conference: attributes_for(:conference, title: 'Example Con') - + conference.reload expect(response).to redirect_to admin_conference_path( conference.short_title) end @@ -51,7 +51,7 @@ describe Admin::ConferenceController do expect(flash[:alert]). 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('dps14') + expect(conference.short_title).to eq("#{conference.short_title}") end it 're-renders the #show template' do @@ -107,14 +107,14 @@ describe Admin::ConferenceController do conference expected = expect do post :create, conference: - attributes_for(:conference) + attributes_for(:conference, short_title: conference.short_title) end expected.to_not change { Conference.count } end it 're-renders the new template' do conference - post :create, conference: attributes_for(:conference) + post :create, conference: attributes_for(:conference, short_title: conference.short_title) expect(response).to redirect_to new_admin_conference_path end end @@ -135,8 +135,7 @@ describe Admin::ConferenceController do describe 'GET #index' do context 'with more than 0 conferences' do it 'populates an array with conferences' do - con2 = create(:conference, short_title: 'dps15', - title: 'The dog and pony show 2015') + con2 = create(:conference) get :index expect(assigns(:conferences)).to match_array([conference, con2]) end diff --git a/spec/factories/conferences.rb b/spec/factories/conferences.rb index 4479e678..3f783eb6 100644 --- a/spec/factories/conferences.rb +++ b/spec/factories/conferences.rb @@ -3,7 +3,7 @@ FactoryGirl.define do factory :conference do title 'The dog and pony show' - short_title 'dps14' + sequence(:short_title) { |n| "dps#{n}14"} social_tag 'dps14' timezone 'Amsterdam' contact_email 'admin@example.com' diff --git a/spec/factories/difficulty_levels.rb b/spec/factories/difficulty_levels.rb new file mode 100644 index 00000000..e0b634ba --- /dev/null +++ b/spec/factories/difficulty_levels.rb @@ -0,0 +1,8 @@ +FactoryGirl.define do + factory :difficulty_level do + title 'Example Difficulty Level' + description 'Lorem Ipsum dolsum' + color '#ffffff' + conference + end +end \ No newline at end of file diff --git a/spec/factories/email_settings.rb b/spec/factories/email_settings.rb index e7cd0f76..e0856537 100644 --- a/spec/factories/email_settings.rb +++ b/spec/factories/email_settings.rb @@ -2,9 +2,11 @@ FactoryGirl.define do factory :email_settings do - send_on_registration false + send_on_registration true send_on_accepted false send_on_rejected false send_on_confirmed_without_registration false + registration_subject 'Lorem Ipsum Dolsum' + registration_email_template 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit' end end diff --git a/spec/factories/event_type.rb b/spec/factories/event_types.rb similarity index 93% rename from spec/factories/event_type.rb rename to spec/factories/event_types.rb index 4b47202f..d3cd4510 100644 --- a/spec/factories/event_type.rb +++ b/spec/factories/event_types.rb @@ -6,5 +6,6 @@ FactoryGirl.define do length 30 minimum_abstract_length 0 maximum_abstract_length 500 + conference end end diff --git a/spec/factories/rooms.rb b/spec/factories/rooms.rb new file mode 100644 index 00000000..8eb3c3d0 --- /dev/null +++ b/spec/factories/rooms.rb @@ -0,0 +1,7 @@ +FactoryGirl.define do + factory :room do + name 'Example Room' + size 4 + conference + end +end \ No newline at end of file diff --git a/spec/factories/social_events.rb b/spec/factories/social_events.rb new file mode 100644 index 00000000..59e2380d --- /dev/null +++ b/spec/factories/social_events.rb @@ -0,0 +1,8 @@ +FactoryGirl.define do + factory :social_event do + title 'Example Social Event' + description 'Lorem Ipsum Dolsum' + date Date.today + conference + end +end \ No newline at end of file diff --git a/spec/factories/supporter_levels.rb b/spec/factories/supporter_levels.rb new file mode 100644 index 00000000..42117e00 --- /dev/null +++ b/spec/factories/supporter_levels.rb @@ -0,0 +1,7 @@ +FactoryGirl.define do + factory :supporter_level do + title 'Example Supporter Level' + url 'www.example.com' + conference + end +end \ No newline at end of file diff --git a/spec/factories/tracks.rb b/spec/factories/tracks.rb new file mode 100644 index 00000000..d0a96316 --- /dev/null +++ b/spec/factories/tracks.rb @@ -0,0 +1,8 @@ +FactoryGirl.define do + factory :track do + name 'Example Track' + description 'Lorem Ipsum dolsum' + color '#ffffff' + conference + end +end \ No newline at end of file diff --git a/spec/factories/vdays.rb b/spec/factories/vdays.rb new file mode 100644 index 00000000..4ebeb05a --- /dev/null +++ b/spec/factories/vdays.rb @@ -0,0 +1,7 @@ +FactoryGirl.define do + factory :vday do + day Date.today + description 'Lorem Ipsum dolsum' + conference + end +end \ No newline at end of file diff --git a/spec/factories/vpositions.rb b/spec/factories/vpositions.rb new file mode 100644 index 00000000..acc6ab18 --- /dev/null +++ b/spec/factories/vpositions.rb @@ -0,0 +1,11 @@ +FactoryGirl.define do + factory :vposition do + title 'Example Volunteer Position' + description 'Lorem Ipsum dolsum' + conference + + after(:build) do |vposition| + vposition.vdays << build(:vday, conference: vposition.conference) + end + end +end \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 027c7a9e..318b1650 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -44,7 +44,9 @@ RSpec.configure do |config| # Enables devise sign_in function config.include Devise::TestHelpers, type: :controller + # Enables devise sign_in function config.include Devise::TestHelpers, type: :view + # Use capybara-webkit as default javascript driver Capybara.javascript_driver = :webkit @@ -54,6 +56,8 @@ RSpec.configure do |config| # Includes support/flash for feature tests config.include Flash, type: :feature + config.include Sidebar, type: :view + # As we start from scratch in April 2014, let's forbid the old :should syntax config.expect_with :rspec do |c| c.syntax = :expect diff --git a/spec/support/sidebar.rb b/spec/support/sidebar.rb new file mode 100644 index 00000000..d6aebd2b --- /dev/null +++ b/spec/support/sidebar.rb @@ -0,0 +1,9 @@ +module Sidebar + def sidebar + @conference = create(:conference) + assign :conference, @conference + assign :cfp, CallForPapers.new + render + expect(view).to render_template('admin/conference/_sidebar') + end +end \ No newline at end of file diff --git a/spec/views/admin/callforpapers/show.html.haml_spec.rb b/spec/views/admin/callforpapers/show.html.haml_spec.rb new file mode 100644 index 00000000..10a1e0c8 --- /dev/null +++ b/spec/views/admin/callforpapers/show.html.haml_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +describe "admin/callforpapers/show" do + it 'renders conference sidebar' do + expect(sidebar).to be true + end + it 'renders callforpapers details' do + @conference = create(:conference) + assign :conference, @conference + assign :cfp, stub_model(CallForPapers, start_date: Date.today, + end_date: Date.today + 7.days, + hard_deadline: Date.today + 6.days, description: "Lorem Ipsum Dolsum") + render + expect(rendered).to include("#{Date.today}") + expect(rendered).to include("#{Date.today + 7.days}") + expect(rendered).to include('Lorem Ipsum Dolsum') + end +end diff --git a/spec/views/admin/conference/index.html.haml_spec.rb b/spec/views/admin/conference/index.html.haml_spec.rb new file mode 100644 index 00000000..9896a79c --- /dev/null +++ b/spec/views/admin/conference/index.html.haml_spec.rb @@ -0,0 +1,11 @@ +require 'spec_helper' + +describe "admin/conference/index" do + it 'renders all conference names with links' do + assign(:conferences, [create(:conference, title: 'OpenSUSE'), + create(:conference)]) + render + expect(rendered).to include('OpenSUSE') + expect(rendered).to include("The dog and pony show") + end +end diff --git a/spec/views/admin/conference/new.html.haml_spec.rb b/spec/views/admin/conference/new.html.haml_spec.rb new file mode 100644 index 00000000..cc4df631 --- /dev/null +++ b/spec/views/admin/conference/new.html.haml_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper' + +describe "admin/conference/new" do + it 'renders the new template for the conference' do + assign(:conference, Conference.new) + render + expect(rendered).to include('Basic Information') + assign(:conference, build(:conference)) + render + expect(rendered).to include('The dog and pony show') + end +end diff --git a/spec/views/admin/conference/show.html.haml_spec.rb b/spec/views/admin/conference/show.html.haml_spec.rb new file mode 100644 index 00000000..6154300f --- /dev/null +++ b/spec/views/admin/conference/show.html.haml_spec.rb @@ -0,0 +1,14 @@ +require 'spec_helper' + +describe "admin/conference/show" do + it 'renders conference sidebar' do + expect(sidebar).to be true + end + it 'renders conference details which are editable' do + @conference = create(:conference, title: 'OpenSUSE') + assign :conference, @conference + render + expect(rendered).to include('OpenSUSE') + expect(rendered).to include("#{@conference.contact_email}") + end +end diff --git a/spec/views/admin/difficulty_levels/index.html.haml_spec.rb b/spec/views/admin/difficulty_levels/index.html.haml_spec.rb new file mode 100644 index 00000000..97e76b16 --- /dev/null +++ b/spec/views/admin/difficulty_levels/index.html.haml_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe "admin/difficulty_levels/index" do + it 'renders conference sidebar' do + expect(sidebar).to be true + end + it 'renders difficulty levels' do + @difficulty_level = create(:difficulty_level) + assign :conference, @difficulty_level.conference + render + expect(rendered).to include('Example Difficulty Level') + expect(rendered).to include('Lorem Ipsum dolsum') + expect(rendered).to include('#ffffff') + end +end diff --git a/spec/views/admin/emails/index.html.haml_spec.rb b/spec/views/admin/emails/index.html.haml_spec.rb new file mode 100644 index 00000000..6ac56f34 --- /dev/null +++ b/spec/views/admin/emails/index.html.haml_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +describe "admin/emails/index" do + it 'renders conference sidebar' do + assign :settings, create(:email_settings) + expect(sidebar).to be true + end + + it 'renders email templates' do + @conference = create(:conference) + assign :conference, @conference + @settings = create(:email_settings) + assign :settings, @settings + render + expect(rendered).to have_selector("input[type='checkbox'][value='1']", + :count=>4) + expect(rendered).to have_selector( + "input[checked='checked'][type='checkbox'][value='1']", :count=> 1) + expect(rendered).to include('Lorem Ipsum Dolsum') + expect(rendered).to include( + 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit') + end +end diff --git a/spec/views/admin/eventtypes/index.html.haml_spec.rb b/spec/views/admin/eventtypes/index.html.haml_spec.rb new file mode 100644 index 00000000..78a59051 --- /dev/null +++ b/spec/views/admin/eventtypes/index.html.haml_spec.rb @@ -0,0 +1,17 @@ +require 'spec_helper' + +describe "admin/eventtypes/index" do + it 'renders conference sidebar' do + expect(sidebar).to be true + end + + it 'renders event types' do + @event_type = create(:event_type) + assign :conference, @event_type.conference + render + expect(rendered).to include('Example Event Type') + expect(rendered).to include('30') + expect(rendered).to include('0') + expect(rendered).to include('500') + end +end diff --git a/spec/views/admin/rooms/index.html.haml_spec.rb b/spec/views/admin/rooms/index.html.haml_spec.rb new file mode 100644 index 00000000..774f67e0 --- /dev/null +++ b/spec/views/admin/rooms/index.html.haml_spec.rb @@ -0,0 +1,14 @@ +require 'spec_helper' + +describe "admin/rooms/index" do + it 'renders conference sidebar' do + expect(sidebar).to be true + end + it 'renders rooms list' do + @room = create(:room) + assign :conference, @room.conference + render + expect(rendered).to include('Example Room') + expect(rendered).to include('4') + end +end \ No newline at end of file diff --git a/spec/views/admin/social_events/index.html.haml_spec.rb b/spec/views/admin/social_events/index.html.haml_spec.rb new file mode 100644 index 00000000..9fd9ce47 --- /dev/null +++ b/spec/views/admin/social_events/index.html.haml_spec.rb @@ -0,0 +1,17 @@ +require 'spec_helper' + +describe "admin/social_events/index" do + it 'renders conference sidebar' do + expect(sidebar).to be true + end + it 'renders social events' do + @social_event = create(:social_event) + assign :conference, @social_event.conference + render + expect(rendered).to include('Example Social Event') + expect(rendered).to include('Lorem Ipsum Dolsum') + expect(rendered).to include("#{Date.today.strftime('%Y')}") + expect(rendered).to include("#{Date.today.strftime('%B')}") + expect(rendered).to include("#{Date.today.strftime('%d')}") + end +end diff --git a/spec/views/admin/supporter_levels/index.html.haml_spec.rb b/spec/views/admin/supporter_levels/index.html.haml_spec.rb new file mode 100644 index 00000000..d8b2c6d2 --- /dev/null +++ b/spec/views/admin/supporter_levels/index.html.haml_spec.rb @@ -0,0 +1,14 @@ +require 'spec_helper' + +describe "admin/supporter_levels/index" do + it 'renders conference sidebar' do + expect(sidebar).to be true + end + it 'renders supporter levels' do + @support_level = create(:supporter_level) + assign :conference, @support_level.conference + render + expect(rendered).to include('Example Supporter Level') + expect(rendered).to include('www.example.com') + end +end diff --git a/spec/views/admin/tracks/index.html.haml_spec.rb b/spec/views/admin/tracks/index.html.haml_spec.rb new file mode 100644 index 00000000..6f0a9187 --- /dev/null +++ b/spec/views/admin/tracks/index.html.haml_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe "admin/tracks/index" do + it 'renders conference sidebar' do + expect(sidebar).to be true + end + it 'renders tracks' do + @track = create(:track) + assign :conference, @track.conference + render + expect(rendered).to include('Example Track') + expect(rendered).to include('Lorem Ipsum dolsum') + expect(rendered).to include('#ffffff') + end +end diff --git a/spec/views/admin/venue/venue_info.html.haml_spec.rb b/spec/views/admin/venue/venue_info.html.haml_spec.rb new file mode 100644 index 00000000..596c782d --- /dev/null +++ b/spec/views/admin/venue/venue_info.html.haml_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe "admin/venue/venue_info" do + it 'renders conference sidebar' do + assign :venue, stub_model(Venue) + expect(sidebar).to be true + end + it 'renders venue#show' do + @conference = create(:conference) + @venue = @conference.venue + @venue.name = 'Croatia' + @venue.description = 'Lorem ipsum dolsum' + @venue.save! + assign :conference, @conference + assign :venue, @venue + render + expect(rendered).to include('Croatia') + expect(rendered).to include('Lorem ipsum dolsum') + end +end diff --git a/spec/views/admin/volunteers/index.html.haml_spec.rb b/spec/views/admin/volunteers/index.html.haml_spec.rb new file mode 100644 index 00000000..8ee83017 --- /dev/null +++ b/spec/views/admin/volunteers/index.html.haml_spec.rb @@ -0,0 +1,31 @@ +require 'spec_helper' + +describe "admin/volunteers/index" do + it 'renders conference sidebar' do + expect(sidebar).to be true + end + + it 'renders volunteers days as vdays' do + @vday = create(:vday) + @vday.conference.update_attributes(use_volunteers: true, use_vdays: true) + assign :conference, @vday.conference + render + expect(rendered).to have_selector( + "input[checked='checked'][type='checkbox'][value='1']", count: 2) + expect(rendered).to include("#{Date.today.strftime('%Y')}") + expect(rendered).to include("#{Date.today.strftime('%B')}") + expect(rendered).to include("#{Date.today.strftime('%d')}") + expect(rendered).to include('Lorem Ipsum dolsum') + end + + it 'renders volunteers positions as vpositions' do + @vposition = create(:vposition) + @vposition.conference.update_attributes( + use_vpositions: true, use_volunteers: true, use_vdays: true) + assign :conference, @vposition.conference + render + expect(rendered).to include("#{Date.today}") + expect(rendered).to include('Example Volunteer Position') + expect(rendered).to include('Lorem Ipsum dolsum') + end +end diff --git a/spec/views/admin/volunteers/show.html.haml_spec.rb b/spec/views/admin/volunteers/show.html.haml_spec.rb new file mode 100644 index 00000000..25646308 --- /dev/null +++ b/spec/views/admin/volunteers/show.html.haml_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe "admin/volunteers/show" do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/views/home/index.html.haml_spec.rb b/spec/views/home/index.html.haml_spec.rb new file mode 100644 index 00000000..ac4e5362 --- /dev/null +++ b/spec/views/home/index.html.haml_spec.rb @@ -0,0 +1,9 @@ +require 'spec_helper' + +describe "home/index" do + it "renders _conference partial for each conference" do + assign(:current, [create(:conference), create(:conference)]) + render + expect(view).to render_template(:partial => "_conference_details", :count => 2) + end +end