Sha256: 433ece78d224cc1441f91a06e6c735445c61b432c673d00bf90c5ccd75a5afaf

Contents?: true

Size: 1.34 KB

Versions: 4

Compression:

Stored size: 1.34 KB

Contents

require 'test_helper'

module RdStation
  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, emial: @lead.emial, 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, emial: @lead.emial, 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

4 entries across 4 versions & 1 rubygems

Version Path
rd_station-0.0.4 test/controllers/rd_station/leads_controller_test.rb
rd_station-0.0.3 test/controllers/rd_station/leads_controller_test.rb
rd_station-0.0.2 test/controllers/rd_station/leads_controller_test.rb
rd_station-0.0.1 test/controllers/rd_station/leads_controller_test.rb