Skip to content

Commit

Permalink
Merge pull request civictechdc#290 from uncompiled/master
Browse files Browse the repository at this point in the history
Change valid values of Citizenship civictechdc#266
  • Loading branch information
jrunningen committed Apr 1, 2015
2 parents fc80f89 + 85608f1 commit 6596af0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
9 changes: 9 additions & 0 deletions app/helpers/citizenship_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module CitizenshipHelper
def citizenship_statuses
[
"US Citizen",
"Non-Citizen with eligible immigration status",
"Other"
]
end
end
2 changes: 1 addition & 1 deletion app/models/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def full_name
end

def us_citizen?
return "United States" == citizenship
return "US Citizen" == citizenship
end

def preferred_phone
Expand Down
2 changes: 1 addition & 1 deletion app/views/people/_demographic.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<%= builder.collection_select :driver_license_state, us_states, :last, :first, label: 'Driver license or non-driver ID state' %>
<%= builder.collection_select :state_of_birth, us_states, :last, :first %>
<%= builder.collection_select :country_of_birth, countries, :to_s, :to_s %>
<%= builder.collection_select :citizenship, countries, :to_s, :to_s %>
<%= builder.collection_select :citizenship, citizenship_statuses, :to_s, :to_s %>
<%= builder.text_field :driver_license_number, label: "Driver license or non-driver ID number" %>

<% %i(
Expand Down
2 changes: 1 addition & 1 deletion lib/applicant_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def make_a_person(applicant)
work_phone: Faker::PhoneNumber.phone_number,
home_phone: Faker::PhoneNumber.phone_number,
cell_phone: Faker::PhoneNumber.phone_number,
citizenship: Faker::Address.country,
citizenship: ["US Citizen", "Non-Citizen with eligible immigration status", "Other"].sample,
country_of_birth: Faker::Address.country,
state_of_birth: Faker::Address.state_abbr,
city_of_birth: Faker::Address.city,
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/people.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ one:
mail_address: one
state_of_birth: VA
city_of_birth: Springfield
citizenship: United States
citizenship: US Citizen
driver_license_number: X12345678
driver_license_state: NY
marital_status: Married
Expand Down Expand Up @@ -45,7 +45,7 @@ hh1:
work_phone: 788-243-3188 x97905
home_phone: 1-437-053-5113 x41799
cell_phone: 839.897.3785 x24946
citizenship: Mayotte
citizenship: Other
country_of_birth: Bosnia and Herzegovina
email: [email protected]
race: Native Hawaiian or Other Pacific Islander
Expand Down
4 changes: 2 additions & 2 deletions test/unit/field_filling_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def setup
test 'nationality and citizenship are the same' do
app = applicants(:one)

assert_equal "United States", app.field("Citizenship")
assert_equal "United States", app.field("Nationality")
assert_equal "US Citizen", app.field("Citizenship")
assert_equal "US Citizen", app.field("Nationality")
end
end

0 comments on commit 6596af0

Please sign in to comment.