Sha256: cda3e968e1dc450fca109ba3b771768373d771ec6f45814cf6101aa62ecea8d7

Contents?: true

Size: 801 Bytes

Versions: 13

Compression:

Stored size: 801 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe <%= user_plural_class_name %>Controller do
  fixtures :all
  integrate_views

  it "new action should render new template" do
    get :new
    response.should render_template(:new)
  end

  it "create action should render new template when model is invalid" do
    <%= user_class_name %>.any_instance.stubs(:valid?).returns(false)
    post :create
    response.should render_template(:new)
  end

  it "create action should redirect when model is valid" do
    <%= user_class_name %>.any_instance.stubs(:valid?).returns(true)
    post :create
    response.should redirect_to(root_url)
  <%- unless options[:authlogic] -%>
    session['<%= user_singular_name %>_id'].should == assigns['<%= user_singular_name %>'].id
  <%- end -%>
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
flockonus-nifty-generators-0.0.12 rails_generators/nifty_authentication/templates/tests/rspec/users_controller.rb
nifty-generators-0.4.6 rails_generators/nifty_authentication/templates/tests/rspec/users_controller.rb
flockonus-nifty-generators-0.0.11 rails_generators/nifty_authentication/templates/tests/rspec/users_controller.rb
flockonus-nifty-generators-0.0.10 rails_generators/nifty_authentication/templates/tests/rspec/users_controller.rb
flockonus-nifty-generators-0.0.9 rails_generators/nifty_authentication/templates/tests/rspec/users_controller.rb
nifty-generators-0.4.5 rails_generators/nifty_authentication/templates/tests/rspec/users_controller.rb
flockonus-nifty-generators-0.0.8 rails_generators/nifty_authentication/templates/tests/rspec/users_controller.rb
flockonus-nifty-generators-0.0.7 rails_generators/nifty_authentication/templates/tests/rspec/users_controller.rb
flockonus-nifty-generators-0.0.6 rails_generators/nifty_authentication/templates/tests/rspec/users_controller.rb
nifty-generators-0.4.4 rails_generators/nifty_authentication/templates/tests/rspec/users_controller.rb
nifty-generators-0.4.3 rails_generators/nifty_authentication/templates/tests/rspec/users_controller.rb
nifty-generators-0.4.2 rails_generators/nifty_authentication/templates/tests/rspec/users_controller.rb
nifty-generators-0.4.1 rails_generators/nifty_authentication/templates/tests/rspec/users_controller.rb