Skip to content

Commit

Permalink
Merge pull request #16806 from opf/implementation/58087-disable-built…
Browse files Browse the repository at this point in the history
…-in-oauth-application-by-default

[#58087] disable seeded built-in oauth application
  • Loading branch information
Kharonus authored Sep 27, 2024
2 parents 71a4527 + d282694 commit 8cae129
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/seeders/oauth_applications_seeder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def create_app
OAuth::Applications::CreateService
.new(user: User.system)
.call(
enabled: true,
enabled: false,
name: "OpenProject Mobile App",
redirect_uri: "openprojectapp://oauth-callback",
builtin: true,
Expand Down
10 changes: 5 additions & 5 deletions spec/features/admin/oauth/oauth_applications_management_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,23 +106,23 @@
within_test_selector("op-admin-oauth--built-in-applications") do
expect(page).to have_test_selector("op-admin-oauth--application", count: 1)
expect(page).to have_link(text: "OpenProject Mobile App")
expect(page).to have_test_selector("op-admin-oauth--application-enabled-toggle-switch", text: "On")
expect(page).to have_test_selector("op-admin-oauth--application-enabled-toggle-switch", text: "Off")

find_test_selector("op-admin-oauth--application-enabled-toggle-switch").click
expect(page).not_to have_test_selector("op-admin-oauth--application-enabled-toggle-switch", text: "Loading")
expect(page).to have_test_selector("op-admin-oauth--application-enabled-toggle-switch", text: "Off")
expect(page).to have_test_selector("op-admin-oauth--application-enabled-toggle-switch", text: "On")

app.reload
expect(app).to be_builtin
expect(app).not_to be_enabled
expect(app).to be_enabled

find_test_selector("op-admin-oauth--application-enabled-toggle-switch").click
expect(page).not_to have_test_selector("op-admin-oauth--application-enabled-toggle-switch", text: "Loading")
expect(page).to have_test_selector("op-admin-oauth--application-enabled-toggle-switch", text: "On")
expect(page).to have_test_selector("op-admin-oauth--application-enabled-toggle-switch", text: "Off")

app.reload
expect(app).to be_builtin
expect(app).to be_enabled
expect(app).not_to be_enabled

click_on "OpenProject Mobile App"
end
Expand Down

0 comments on commit 8cae129

Please sign in to comment.