update authentication system to Devise
This commit is contained in:
24
spec/controllers/registrations_controller_spec.rb
Normal file
24
spec/controllers/registrations_controller_spec.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe RegistrationsController do
|
||||
|
||||
describe "new account" do
|
||||
render_views
|
||||
|
||||
it "should create a new user if user parameters are complete" do
|
||||
@request.env["devise.mapping"] = Devise.mappings[:user]
|
||||
post :create, :user => {"login"=>"xxx", "email"=>"xxx@insomnia-consulting.org", "time_zone"=>"Eastern Time (US & Canada)", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}
|
||||
response.code.should == "302"
|
||||
response.should redirect_to(channels_path)
|
||||
end
|
||||
|
||||
it "should have a valid api_key" do
|
||||
@request.env["devise.mapping"] = Devise.mappings[:user]
|
||||
post :create, :user => {"login"=>"xxx", "email"=>"xxx@insomnia-consulting.org", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}
|
||||
assigns[:user].api_key.length.should eq(16)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user