Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Update tests for time entry activities

Klaus Zanders45f44689e256
diff --git a/modules/costs/spec/features/time_entry/activity_spec.rb b/modules/costs/spec/features/time_entry/activity_spec.rb
index fb9a3d88a12..69c305c4612 100644
--- a/modules/costs/spec/features/time_entry/activity_spec.rb
+++ b/modules/costs/spec/features/time_entry/activity_spec.rb
@@ -36,37 +36,31 @@ RSpec.describe "Time entry activity" do
login_as(admin)
end
- it "supports CRUD" do
- pending "this is currently isaled as we move to their own page"
+ it "allows creating new activities and activating them on projects" do
+ visit admin_time_entry_activities_path
- visit enumerations_path
-
- page.find_test_selector("create-enumeration-time-entry-activity").click
+ page.find_test_selector("add-activity-button").click
fill_in "Name", with: "A new activity"
- click_on("Create")
+ click_on("Save")
- expect(page.current_path)
- .to eql enumerations_path
+ # we are redirected back to the index page
+ expect(page).to have_current_path(admin_time_entry_activities_path)
- expect(page)
- .to have_content("A new activity")
+ expect(page).to have_content("A new activity")
visit project_settings_general_path(project)
click_on "Time tracking activities"
- expect(page)
- .to have_field("A new activity", checked: true)
+ expect(page).to have_field("A new activity", checked: true)
uncheck "A new activity"
click_on "Save"
- expect(page)
- .to have_content "Successful update."
+ expect(page).to have_content "Successful update."
- expect(page)
- .to have_field("A new activity", checked: false)
+ expect(page).to have_field("A new activity", checked: false)
end
end