Created
January 25, 2021 10:52
-
-
Save imhilla/daddfbcefe9eb12efa81a08aeabe9937 to your computer and use it in GitHub Desktop.
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
| def do_signup(_name, _username, _email, _password) | |
| visit root_path | |
| click_button('SIGN UP') | |
| attach_file('user[image]', "#{Rails.root}/spec/files/attachment.jpeg", visible: false) | |
| find("input[placeholder='Name']").set 'hillary' | |
| find("input[placeholder='Username']").set 'hillary' | |
| find("input[placeholder='Email']").set '[email protected]' | |
| find("input[placeholder='Password']").set '123456' | |
| find("input[placeholder='Password confirmation']").set '123456' | |
| click_button('sign_up') | |
| end | |
| def do_login(_username, _password) | |
| visit root_path | |
| click_button('LOG IN') | |
| find("input[placeholder='Username']").set 'hillary' | |
| find("input[placeholder='Password']").set '123456' | |
| click_button('sign_in') | |
| end | |
| def create_article | |
| fill_in('Title', with: 'What is a capstone project') | |
| fill_in('Title', with: 'What is a capstone project?') | |
| fill_in('Body', with: 'Capstone projects are projects to test your mastery of a particular section') | |
| click_button('submitc') | |
| end | |
| def create_group | |
| fill_in('Name', with: 'Amazon') | |
| attach_file('group[icon]', "#{Rails.root}/spec/files/attachment.jpeg", visible: false) | |
| click_button('Create Group') | |
| end | |
| def create_article_group | |
| select 'Amazon', from: 'group_id' | |
| fill_in('Title', with: 'What is a capstone project') | |
| fill_in('Title', with: 'What is a capstone project?') | |
| fill_in('Body', with: 'Capstone projects') | |
| click_button('submitc') | |
| end | |
| def create_comment | |
| click_button('comment') | |
| fill_in('Body', with: 'I am working on my capstone right now') | |
| click_button('commit') | |
| end | |
| def create_like | |
| click_button('like') | |
| end | |
| def splash_page | |
| visit root_path | |
| end | |
| end |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is meant to show integration tests with Rspec.