Last active
August 29, 2015 14:08
-
-
Save thiagoramos23/95787a20cf6b2eb9d032 to your computer and use it in GitHub Desktop.
new_residence_page_object
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
| class NewResidencePageObject < BaseObject | |
| def has_current_path?(path) | |
| current_path == path | |
| end | |
| def fill_in_with_residence(residence) | |
| find("#residence_latitude").set(residence.latitude) | |
| find("#residence_longitude").set(residence.longitude) | |
| fill_in I18n.t('activerecord.attributes.residence.type_of_patio'), with: residence.type_of_patio | |
| fill_in I18n.t('activerecord.attributes.residence.name_of_patio'), with: residence.name_of_patio | |
| find("#residence_number").set(residence.number) | |
| fill_in I18n.t('activerecord.attributes.residence.municipality'), with: residence.municipality | |
| select('RJ', from: I18n.t('activerecord.attributes.residence.uf')) | |
| fill_in I18n.t('activerecord.attributes.residence.cep'), with: residence.cep | |
| fill_in I18n.t('activerecord.attributes.residence.complement'), with: residence.complement | |
| fill_in I18n.t('activerecord.attributes.residence.residencial_phone'), with: residence.residencial_phone | |
| choose(I18n.t('activerecord.attributes.residence.housing_situations.own')) | |
| choose(I18n.t('activerecord.attributes.residence.type_residences.house')) | |
| fill_in I18n.t('activerecord.attributes.residence.number_of_residents'), with: residence.number_of_residents | |
| choose(I18n.t('activerecord.attributes.residence.conditions_of_land_uses.owner')) | |
| choose('residence_has_energy_power_true') | |
| end | |
| def make_blank_field(field) | |
| find(field).set('') | |
| end | |
| def click_on_save | |
| click_on 'Criar Domicílio' | |
| IndexResidencePage.new | |
| end | |
| def has_invalid_message_on_div?(klass) | |
| within(klass) do | |
| has_content?(I18n.t('errors.messages.blank')) | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment