Sha256: 57217487b9ab06748d518ef73c728232f8f54e71c57cd068153902cbba87ac71

Contents?: true

Size: 673 Bytes

Versions: 2

Compression:

Stored size: 673 Bytes

Contents

require "minitest_helper"

describe UsersController do

  describe "GET new" do
    before do
      get :new
    end

    it { response.status.must_equal 200 }
    it { response.body.must_include "Sign Up" }
    it { assigns[:user].new_record?.must_equal(true) }
  end

  describe "POST create" do
    describe "with valid params" do
      before do
        UsersController.any_instance.stubs(:warden).returns(stub(set_user: nil))
        post :create, user: { email: "valid@valid.com", password: "123456", password_confirmation: "123456" }
      end

      it { response.status.must_equal 302 }
      it { assigns[:user].new_record?.must_equal(false) }
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
thincloud-auth-0.1.2 lib/generators/thincloud/auth/templates/users_controller_test.rb
thincloud-auth-0.1.1 lib/generators/thincloud/auth/templates/users_controller_spec.rb