Sha256: 600469633ffa075b4da1018ddc78708db9a3b253ba3b118aa95487448446ebe3

Contents?: true

Size: 1.34 KB

Versions: 10

Compression:

Stored size: 1.34 KB

Contents

require 'test_helper'

module LeadsToHighrise
  class LeadsControllerTest < ActionController::TestCase
    setup do
      @lead = leads(:one)
    end

    test "should get index" do
      get :index
      assert_response :success
      assert_not_nil assigns(:leads)
    end

    test "should get new" do
      get :new
      assert_response :success
    end

    test "should create lead" do
      assert_difference('Lead.count') do
        post :create, lead: { company: @lead.company, email: @lead.email, job_title: @lead.job_title, last_name: @lead.last_name, name: @lead.name, phone: @lead.phone, website: @lead.website }
      end

      assert_redirected_to lead_path(assigns(:lead))
    end

    test "should show lead" do
      get :show, id: @lead
      assert_response :success
    end

    test "should get edit" do
      get :edit, id: @lead
      assert_response :success
    end

    test "should update lead" do
      patch :update, id: @lead, lead: { company: @lead.company, email: @lead.email, job_title: @lead.job_title, last_name: @lead.last_name, name: @lead.name, phone: @lead.phone, website: @lead.website }
      assert_redirected_to lead_path(assigns(:lead))
    end

    test "should destroy lead" do
      assert_difference('Lead.count', -1) do
        delete :destroy, id: @lead
      end

      assert_redirected_to leads_path
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
leads_to_highrise-0.1.9 test/controllers/leads_to_highrise/leads_controller_test.rb
leads_to_highrise-0.1.8 test/controllers/leads_to_highrise/leads_controller_test.rb
leads_to_highrise-0.1.7 test/controllers/leads_to_highrise/leads_controller_test.rb
leads_to_highrise-0.1.6 test/controllers/leads_to_highrise/leads_controller_test.rb
leads_to_highrise-0.1.5 test/controllers/leads_to_highrise/leads_controller_test.rb
leads_to_highrise-0.1.4 test/controllers/leads_to_highrise/leads_controller_test.rb
leads_to_highrise-0.0.4 test/controllers/leads_to_highrise/leads_controller_test.rb
leads_to_highrise-0.0.3 test/controllers/leads_to_highrise/leads_controller_test.rb
leads_to_highrise-0.0.2 test/controllers/leads_to_highrise/leads_controller_test.rb
leads_to_highrise-0.0.1 test/controllers/leads_to_highrise/leads_controller_test.rb