Last active
December 15, 2015 11:49
-
-
Save r00k/5256238 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= state.commission_name %> | |
<%= state.commission_homepage_url %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= render 'state_comparison/state', state: @state_1 %> | |
<%= render 'state_comparison/state', state: @state_2 %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe 'rendering the state compare view' do | |
it 'displays both commission names' do | |
state_1 = build_stubbed(:state, commission_name: 'ABC') | |
state_2 = build_stubbed(:state, commission_name: 'XYZ') | |
assign(:state_1, state_1) | |
assign(:state_2, state_2) | |
render template: 'state_comparison/show' | |
expect(rendered).to include(state_1.commission_name) | |
expect(rendered).to include(state_2.commission_name) | |
end | |
it 'displays both commission websites' do | |
state_1 = build_stubbed(:state, commission_homepage_url: 'http://state1.gov') | |
state_2 = build_stubbed(:state, commission_homepage_url: 'http://state2.gov') | |
assign(:state_1, state_1) | |
assign(:state_2, state_2) | |
render template: 'state_comparison/show' | |
expect(rendered).to include(state_1.commission_homepage_url) | |
expect(rendered).to include(state_2.commission_homepage_url) | |
end | |
it 'displays the number of commissioners for each state' do | |
state_1 = build_stubbed(:state, commissioner_count: 1) | |
state_2 = build_stubbed(:state, commissioner_count: 2) | |
assign(:state_1, state_1) | |
assign(:state_2, state_2) | |
render template: 'state_comparison/show' | |
expect(rendered).to include(state_1.commissioner_count.to_s) | |
expect(rendered).to include(state_2.commissioner_count.to_s) | |
end | |
it 'displays the commissioner selection method' do | |
state_1 = build_stubbed(:state, commissioner_selection_method: 'Elected') | |
state_2 = build_stubbed(:state, commissioner_selection_method: 'Appointed') | |
assign(:state_1, state_1) | |
assign(:state_2, state_2) | |
render template: 'state_comparison/show' | |
expect(rendered).to include(state_1.commissioner_selection_method) | |
expect(rendered).to include(state_2.commissioner_selection_method) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment