Track steps the user has completed, nag them to finish it.

This commit is contained in:
Robin Ward
2016-09-14 16:36:08 -04:00
parent ef84981e38
commit 29cf47cfb2
21 changed files with 290 additions and 19 deletions

View File

@ -2,6 +2,10 @@ require 'rails_helper'
describe StepsController do
before do
SiteSetting.wizard_enabled = true
end
it 'needs you to be logged in' do
expect {
xhr :put, :update, id: 'made-up-id', fields: { forum_title: "updated title" }
@ -19,6 +23,12 @@ describe StepsController do
log_in(:admin)
end
it "raises an error if the wizard is disabled" do
SiteSetting.wizard_enabled = false
xhr :put, :update, id: 'contact', fields: { contact_email: "eviltrout@example.com" }
expect(response).to be_forbidden
end
it "updates properly if you are staff" do
xhr :put, :update, id: 'contact', fields: { contact_email: "eviltrout@example.com" }
expect(response).to be_success