Sha256: 2d7428214064bcfb11f12d16ecba16a55a47ebeb6c90ae8b4f890b9981cba065

Contents?: true

Size: 1001 Bytes

Versions: 38

Compression:

Stored size: 1001 Bytes

Contents

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

class Muck::UsernameRequestControllerTest < ActionController::TestCase

  tests Muck::UsernameRequestController

  context "username request controller" do
    setup do
      @user = Factory(:user)
    end
    context "get new" do
      setup do
        get :new
      end
      should_respond_with :success
      should_render_template :new
    end
    context "find user using email and send email message" do
      setup do
        post :create, :request_username => { :email => @user.email }
      end
      should "send username" do
        assert_sent_email do |email|
          email.to.include?(@user.email)
        end
      end
      should_redirect_to("login") { login_path }
    end
    context "bad email - fail to send username" do
      setup do
        post :create, :request_username => { :email => 'quentin@bad_email_example.com' }
      end
      should_respond_with :success
      should_render_template :new
    end

  end

end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
muck-users-0.3.20 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.19 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.18 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.17 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.16 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.15 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.14 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.13 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.12 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.11 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.10 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.9 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.8 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.7 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.6 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.4 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.3 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.2 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.1 test/rails_root/test/functional/username_request_controller_test.rb
muck-users-0.3.0 test/rails_root/test/functional/username_request_controller_test.rb