Created
September 21, 2023 21:09
-
-
Save jbennett/7382859cc9e3740d265ba025306dfb02 to your computer and use it in GitHub Desktop.
CRMmy Review
This file contains 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 click_nav(label) | |
within "#desktop-nav" do | |
click_on label | |
end | |
end | |
scenario "navigate to projects page" do | |
click_nav "Projects" | |
expect(page).to have_content "Projects" | |
end |
This file contains 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
RSpec.feature "UsersCanManageProjects", type: :feature do | |
scenario "successfully", :js do | |
user = create(:user, :with_account) | |
visit root_path(as: user) | |
click_on "Select" | |
click_on "Projects", match: :first | |
click_on "Add Project" | |
fill_in "Name", with: "My Project" | |
click_on "Create Project" | |
click_on "My Project" | |
click_on "Edit" | |
fill_in "Name", with: "New Project" | |
click_on "Update Project" | |
expect(page).to have_content "New Project" | |
end | |
end |
This file contains 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
RSpec.feature "UsersCanManageProjects", type: :feature do | |
let(:user) { create(:user, :with_account) } | |
before do | |
visit root_path(as: user) | |
click_on "Select" | |
end | |
scenario "navigate to projects page" do | |
click_on "Projects", match: :first | |
expect(page).to have_content "Projects" | |
end | |
scenario "add a project" do | |
visit projects_path | |
click_on "Add Project" | |
fill_in "Name", with: "My Project" | |
click_on "Create Project" | |
expect(page).to have_content "My Project" | |
end | |
scenario "edit a project" do | |
project = create :project, account: user.accounts.first | |
visit projects_path | |
click_on project.name | |
click_on "Edit" | |
fill_in "Name", with: "New Project" | |
click_on "Update Project" | |
expect(page).to have_content "New Project" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment