discourse/spec/requests/steps_controller_spec.rb
Blake Erickson ae2153b330
UX: Wizard Step Enhancements (#19487)
* UX: Wizard Step Enhancements

- Remove illustrations
- Add Emoji graphic to top of steps
- Add description below step title
- Move point of contact to last step

* Move step count to header, plus some button navigation tweaks

* add remaining emoji to step headers

* fix button logic on steps

* Update Point of Contact

* remove automated messages field

* adjust styling for counter, title, and emoji

* Update wording for logos

* Fix tests

* fix prettier

* fix specs

* set same with for steps except for styling screen

* use sentence case; remove duplicate copy under your organization fields

* fix missing buttons on small screens

* add spacing to buttons; adjust font weight to labels

* adjust styling for community logo step; use sentence case for button

* update copy for point of contact text helper

* use sentence case for field labels

* fix ui tests

* use btn-back class to fix ui tests

* reduce bottom margin for toggle fields

* clean up

Co-authored-by: Ella <ella.estigoy@gmail.com>
2022-12-19 17:24:09 -07:00

55 lines
1.3 KiB
Ruby

# frozen_string_literal: true
RSpec.describe StepsController do
before do
SiteSetting.wizard_enabled = true
end
it 'needs you to be logged in' do
put "/wizard/steps/made-up-id.json", params: {
fields: { forum_title: "updated title" }
}
expect(response.status).to eq(403)
end
it "raises an error if you aren't an admin" do
sign_in(Fabricate(:moderator))
put "/wizard/steps/made-up-id.json", params: {
fields: { forum_title: "updated title" }
}
expect(response).to be_forbidden
end
context "as an admin" do
before do
sign_in(Fabricate(:admin))
end
it "raises an error if the wizard is disabled" do
SiteSetting.wizard_enabled = false
put "/wizard/steps/introduction.json", params: {
fields: { contact_email: "eviltrout@example.com" }
}
expect(response).to be_forbidden
end
it "updates properly if you are staff" do
put "/wizard/steps/introduction.json", params: {
fields: { title: "FooBar", default_locale: SiteSetting.default_locale }
}
expect(response.status).to eq(200)
end
it "returns errors if the field has them" do
put "/wizard/steps/introduction.json", params: {
fields: { title: "" }
}
expect(response.status).to eq(422)
end
end
end