Commit 3c93f5c072cd28983a404e178cd81a1d01aaae58
1 parent
82748c1c
Exists in
master
and in
79 other branches
Fix broken unit, cucumber tests
Signed-off-by: Brenddon Gontijo <brenddongontijo@msn.com> Signed-off-by: Fabio Teixeira <fabio1079@gmail.com> Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
Showing
3 changed files
with
14 additions
and
12 deletions
Show diff stats
features/steps_definitions/gov_user_steps.rb
... | ... | @@ -66,7 +66,6 @@ Given /^the following public institutions?$/ do |table| |
66 | 66 | end |
67 | 67 | end |
68 | 68 | |
69 | - | |
70 | 69 | Given /^I sleep for (\d+) seconds$/ do |time| |
71 | 70 | sleep time.to_i |
72 | 71 | end |
... | ... | @@ -87,4 +86,5 @@ Given /^I am logged in as mpog_admin$/ do |
87 | 86 | fill_in("Username", :with => user.login) |
88 | 87 | fill_in("Password", :with => '123456') |
89 | 88 | click_button("Log in") |
90 | -end | |
91 | 89 | \ No newline at end of file |
90 | +end | |
91 | + | ... | ... |
test/unit/gov_user_person_test.rb
test/unit/institution_test.rb
... | ... | @@ -29,34 +29,35 @@ class InstitutionTest < ActiveSupport::TestCase |
29 | 29 | end |
30 | 30 | should "not save institutions without name" do |
31 | 31 | @institution.name = nil |
32 | - assert !@institution.save | |
33 | - assert @institution.errors.full_messages.include? "Name can't be blank" | |
32 | + assert_equal false, @institution.save | |
33 | + assert_equal true, @institution.errors.full_messages.include?("Name can't be blank") | |
34 | 34 | end |
35 | 35 | |
36 | 36 | should "not save if institution has invalid type" do |
37 | 37 | invalid_msg = "Type invalid, only public and private institutions are allowed." |
38 | 38 | @institution.type = "Other type" |
39 | - assert !@institution.save, 'Invalid type' | |
40 | - assert @institution.errors.full_messages.include? invalid_msg | |
39 | + assert_equal false, @institution.save | |
40 | + assert_equal true, @institution.errors.full_messages.include?(invalid_msg) | |
41 | 41 | end |
42 | 42 | |
43 | 43 | should "not save without country" do |
44 | 44 | @institution.community.country = nil |
45 | - assert !@institution.save, "Country can't be blank" | |
46 | - assert @institution.errors.full_messages.include? "Country can't be blank" | |
45 | + assert_equal false, @institution.save | |
46 | + assert_equal true, @institution.errors.full_messages.include?("Country can't be blank") | |
47 | 47 | end |
48 | 48 | |
49 | 49 | should "not save without state" do |
50 | 50 | @institution.community.state = nil |
51 | 51 | |
52 | - assert !@institution.save, "State can't be blank" | |
53 | - assert @institution.errors.full_messages.include? "State can't be blank" | |
52 | + assert_equal false, @institution.save | |
53 | + assert_equal true, @institution.errors.full_messages.include?("State can't be blank") | |
54 | 54 | end |
55 | 55 | |
56 | 56 | should "not save without city" do |
57 | 57 | @institution.community.city = nil |
58 | + @institution.community.state = "DF" | |
58 | 59 | |
59 | - assert !@institution.save, "City can't be blank" | |
60 | - assert @institution.errors.full_messages.include? "City can't be blank" | |
60 | + assert_equal false, @institution.save | |
61 | + assert_equal true, @institution.errors.full_messages.include?("City can't be blank") | |
61 | 62 | end |
62 | 63 | end | ... | ... |