Skip to content
This repository has been archived by the owner on Apr 5, 2020. It is now read-only.

Commit

Permalink
#3 <@mathiasVoelcker, @CristianFerreira> - testar inserção de dados i…
Browse files Browse the repository at this point in the history
…nvalidos em input de solicitar doacao
  • Loading branch information
mathiasVoelcker committed Nov 9, 2016
1 parent 8171a5c commit 21ef3f6
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 7 deletions.
1 change: 1 addition & 0 deletions app/controllers/demand_blood_banks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def index
# GET /demand_blood_banks/new
def new
@demand_blood_bank = DemandBloodBank.new
@demand_blood_bank.save
@lastUpdateNecessity = DemandBloodBank.last.updated_at.strftime("%d/%m/%Y - %H:%M:%S")
end

Expand Down
2 changes: 1 addition & 1 deletion coverage/.last_run.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"result": {
"covered_percent": 70.14
"covered_percent": 71.52
}
}
30 changes: 24 additions & 6 deletions coverage/.resultset.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,23 @@
1,
null,
null,
null,
1,
1,
1,
null,
1,
1,
1,
1,
1,
1,
1,
1,
null,
1,
null,
null,
null
],
"/myapp/spec/rails_helper.rb": [
Expand Down Expand Up @@ -86,7 +103,7 @@
1,
null,
1,
70,
103,
null,
null,
null,
Expand Down Expand Up @@ -949,11 +966,11 @@
1,
null,
1,
6,
8,
null,
null,
1,
6,
8,
null,
null,
1,
Expand Down Expand Up @@ -1167,8 +1184,9 @@
null,
null,
1,
3,
null,
4,
4,
4,
null,
null,
null,
Expand Down Expand Up @@ -1288,6 +1306,6 @@
null
]
},
"timestamp": 1478696082
"timestamp": 1478696829
}
}
17 changes: 17 additions & 0 deletions spec/features/demand_blood_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,21 @@
expect(page).to have_css(".Button.Button--medium.Button--fluid.is-disabled.js-nextButton")
end
end

context "quando inserir dados inválidos" do
it "não deve ativar o botao" do
visit "/necessidadeBanco"

fill_in "demand_blood_bank_a_positive", with: "e"
page.find('#demand_blood_bank_a_positive').trigger(:focusout)
fill_in "demand_blood_bank_b_positive", with: "!"
page.find('#demand_blood_bank_a_positive').trigger(:focusout)
fill_in "demand_blood_bank_a_negative", with: "&"
page.find('#demand_blood_bank_a_negative').trigger(:focusout)
fill_in "demand_blood_bank_b_negative", with: "+"
page.find('#demand_blood_bank_b_negative').trigger(:focusout)

expect(page).to have_css(".Button.Button--medium.Button--fluid.is-disabled.js-nextButton")
end
end
end

0 comments on commit 21ef3f6

Please sign in to comment.