Scaffold for new Wizard - Rails / Ember / Tests

This commit is contained in:
Robin Ward
2016-08-24 14:35:07 -04:00
parent 6070939daa
commit 0471ad393c
23 changed files with 247 additions and 6 deletions

View File

@ -0,0 +1,25 @@
require 'rails_helper'
describe Wizard::WizardController do
context 'index' do
render_views
it 'needs you to be logged in' do
expect { xhr :get, :index }.to raise_error(Discourse::NotLoggedIn)
end
it "raises an error if you aren't an admin" do
log_in
xhr :get, :index
expect(response).to be_forbidden
end
it "renders the wizard if you are an admin" do
log_in(:admin)
xhr :get, :index
expect(response).to be_success
end
end
end