-
-
Notifications
You must be signed in to change notification settings - Fork 391
Expand file tree
/
Copy pathapplication_settings_spec.rb
More file actions
30 lines (21 loc) · 815 Bytes
/
application_settings_spec.rb
File metadata and controls
30 lines (21 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# frozen_string_literal: true
RSpec.describe "application settings" do
it "allows enabling account creation" do
login_as(create(:user, admin: true))
visit(settings_path)
within("form", text: "User signups are disabled") { click_on("Enable") }
expect(page).to have_content("User signups are enabled")
end
it "allows disabling account creation" do
Setting::UserSignup.first.update!(enabled: true)
login_as(create(:user, admin: true))
visit(settings_path)
within("form", text: "User signups are enabled") { click_on("Disable") }
expect(page).to have_content("User signups are disabled")
end
it "prevents signup when signups are disabled" do
create(:user, admin: true)
visit(setup_password_path)
expect(page).to have_current_path(login_path)
end
end