thingspeak/spec/controllers/registrations_controller_spec.rb

25 lines
849 B
Ruby
Raw Normal View History

2014-03-14 00:16:35 +01:00
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