Skip to content

Commit

Permalink
Fix edit public servant spec
Browse files Browse the repository at this point in the history
  • Loading branch information
abisosa committed Apr 16, 2015
1 parent b28240e commit ae45686
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

feature 'As a service admin I can edit a public servant' do

let(:admin) { create(:admin, :service_admin) }
let(:admin) { create(:admin, :service_admin, dependency: "Dependencia 1") }

background do
sign_in_admin admin
end

scenario 'I can edit a public servant' do
public_servants = create_list(:admin, 3, :public_servant)
public_servants = create_list(:admin, 3, :public_servant, dependency: admin.dependency)
first_public_servant = public_servants.first

visit admins_dashboards_path
Expand All @@ -19,13 +19,11 @@
expect(find_field('admin[name]').value).to eq first_public_servant.name

fill_in "admin[name]", with: "New name"
select "Dependencia 2", from: "admin[dependency]"
select "Unidad administrativa 2", from: "admin[administrative_unit]"
click_button "Actualizar"

expect(page).to have_content "El servidor público se ha actualizado exitosamente"
expect(page).to have_content "New name"
expect(page).to have_content "Dependencia 2"
expect(page).to have_content "Unidad administrativa 2"
end

Expand Down

0 comments on commit ae45686

Please sign in to comment.