houndci fixes

This commit is contained in:
Gopesh Tulsyan 2014-05-19 12:49:04 +05:30
parent d1e9bd06a6
commit 7a19fefd53
24 changed files with 39 additions and 33 deletions

View file

@ -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
conference.reload
expect(response).to redirect_to admin_conference_path(
conference.short_title)
end

View file

@ -3,7 +3,7 @@
FactoryGirl.define do
factory :conference do
title 'The dog and pony show'
sequence(:short_title) { |n| "dps#{n}14"}
sequence(:short_title) { |n| "dps#{n}14" }
social_tag 'dps14'
timezone 'Amsterdam'
contact_email 'admin@example.com'

View file

@ -5,4 +5,5 @@ FactoryGirl.define do
color '#ffffff'
conference
end
end

View file

@ -4,4 +4,5 @@ FactoryGirl.define do
size 4
conference
end
end

View file

@ -5,4 +5,5 @@ FactoryGirl.define do
date Date.today
conference
end
end

View file

@ -4,4 +4,5 @@ FactoryGirl.define do
url 'www.example.com'
conference
end
end

View file

@ -5,4 +5,5 @@ FactoryGirl.define do
color '#ffffff'
conference
end
end

View file

@ -4,4 +4,5 @@ FactoryGirl.define do
description 'Lorem Ipsum dolsum'
conference
end
end

View file

@ -8,4 +8,5 @@ FactoryGirl.define do
vposition.vdays << build(:vday, conference: vposition.conference)
end
end
end

View file

@ -2,7 +2,6 @@ module Sidebar
def sidebar
@conference = create(:conference)
assign :conference, @conference
assign :cfp, CallForPapers.new
render
expect(view).to render_template('admin/conference/_sidebar')
end

View file

@ -1,18 +1,20 @@
require 'spec_helper'
describe "admin/callforpapers/show" do
describe 'admin/callforpapers/show' do
it 'renders conference sidebar' do
assign :cfp, CallForPapers.new
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")
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

View file

@ -1,9 +1,8 @@
require 'spec_helper'
describe "admin/conference/index" do
describe 'admin/conference/index' do
it 'renders all conference names with links' do
assign(:conferences, [create(:conference, title: 'OpenSUSE'),
create(:conference)])
assign(:conferences, [create(:conference, title: 'OpenSUSE'), create(:conference)])
render
expect(rendered).to include('OpenSUSE')
expect(rendered).to include("The dog and pony show")

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe "admin/conference/new" do
describe 'admin/conference/new' do
it 'renders the new template for the conference' do
assign(:conference, Conference.new)
render

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe "admin/conference/show" do
describe 'admin/conference/show' do
it 'renders conference sidebar' do
expect(sidebar).to be true
end

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe "admin/difficulty_levels/index" do
describe 'admin/difficulty_levels/index' do
it 'renders conference sidebar' do
expect(sidebar).to be true
end

View file

@ -1,23 +1,22 @@
require 'spec_helper'
describe "admin/emails/index" do
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 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')
expect(rendered).
to include('Lorem ipsum dolor sit amet, consectetuer adipiscing elit')
end
end

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe "admin/eventtypes/index" do
describe 'admin/eventtypes/index' do
it 'renders conference sidebar' do
expect(sidebar).to be true
end

View file

@ -1,6 +1,5 @@
require 'spec_helper'
describe "admin/rooms/index" do
describe 'admin/rooms/index' do
it 'renders conference sidebar' do
expect(sidebar).to be true
end
@ -11,4 +10,5 @@ describe "admin/rooms/index" do
expect(rendered).to include('Example Room')
expect(rendered).to include('4')
end
end

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe "admin/social_events/index" do
describe 'admin/social_events/index' do
it 'renders conference sidebar' do
expect(sidebar).to be true
end

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe "admin/supporter_levels/index" do
describe 'admin/supporter_levels/index' do
it 'renders conference sidebar' do
expect(sidebar).to be true
end

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe "admin/tracks/index" do
describe 'admin/tracks/index' do
it 'renders conference sidebar' do
expect(sidebar).to be true
end

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe "admin/venue/venue_info" do
describe 'admin/venue/venue_info' do
it 'renders conference sidebar' do
assign :venue, stub_model(Venue)
expect(sidebar).to be true

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe "admin/volunteers/index" do
describe 'admin/volunteers/index' do
it 'renders conference sidebar' do
expect(sidebar).to be true
end
@ -11,7 +11,7 @@ describe "admin/volunteers/index" do
assign :conference, @vday.conference
render
expect(rendered).to have_selector(
"input[checked='checked'][type='checkbox'][value='1']", count: 2)
"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')}")
@ -21,7 +21,7 @@ describe "admin/volunteers/index" do
it 'renders volunteers positions as vpositions' do
@vposition = create(:vposition)
@vposition.conference.update_attributes(
use_vpositions: true, use_volunteers: true, use_vdays: true)
use_vpositions: true, use_volunteers: true, use_vdays: true)
assign :conference, @vposition.conference
render
expect(rendered).to include("#{Date.today}")

View file

@ -1,6 +1,6 @@
require 'spec_helper'
describe "home/index" do
describe 'home/index' do
it "renders _conference partial for each conference" do
assign(:current, [create(:conference), create(:conference)])
render