Created
November 8, 2014 03:45
-
-
Save thiagoramos23/b56a4ad1f209f9ac70f8 to your computer and use it in GitHub Desktop.
index_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 IndexResidencePage < BaseObject | |
| def visit_page | |
| visit admin_residences_path | |
| self | |
| end | |
| def has_residence?(residence) | |
| content = find(:xpath, '//table/tbody/tr') | |
| has_expected_fields_in_table(content, residence) | |
| end | |
| def has_message?(message) | |
| has_content?(message) | |
| end | |
| def click_on_new | |
| click_link I18n.t('helpers.links.new') | |
| NewResidencePageObject.new | |
| end | |
| def click_on_edit | |
| click_on I18n.t('helpers.links.edit') | |
| EditResidencePageObject.new | |
| end | |
| def click_on_remove | |
| click_on I18n.t('helpers.links.destroy') | |
| self | |
| end | |
| private | |
| def has_expected_fields_in_table(content, residence) | |
| content.has_content?(residence.name_of_patio) && content.has_content?(residence.cep) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment