View specs, added factories, fixed bugs
This commit is contained in:
parent
322ddd1501
commit
d1e9bd06a6
33 changed files with 319 additions and 12 deletions
31
spec/views/admin/volunteers/index.html.haml_spec.rb
Normal file
31
spec/views/admin/volunteers/index.html.haml_spec.rb
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue