Sha256: aa4522882f5265af58d2de12d7beafa2b13e6f553cc6103d03b18e5864927b40

Contents?: true

Size: 992 Bytes

Versions: 5

Compression:

Stored size: 992 Bytes

Contents

require 'rails_helper'

describe HasVcards::PhoneNumbersController do
  routes { HasVcards::Engine.routes }
  before { @phone_number = FactoryGirl.create :phone_number }

  describe "GET 'show'" do

    it 'returns http success' do
      get :show, { id: @phone_number.id }
      expect(response).to be_success
    end

    it 'renders the show template' do
      get :show, { id: @phone_number.id }
      expect(response).to render_template('show')
    end

    it 'loads the specified record' do
      get :show, { id: @phone_number.id }
      expect(assigns(:phone_number)).to match(@phone_number)
    end
  end

  describe "GET 'index'" do

    it 'returns http success' do
      get :index
      expect(response).to be_success
    end

    it 'renders the index template' do
      get :index
      expect(response).to render_template('index')
    end

    it 'loads all records' do
      get :index
      expect(assigns(:phone_numbers)).to match_array([@phone_number])
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
has_vcards-1.1.2 spec/controllers/has_vcards/phone_numbers_controller_spec.rb
has_vcards-1.1.1 spec/controllers/has_vcards/phone_numbers_controller_spec.rb
has_vcards-1.1.0 spec/controllers/has_vcards/phone_numbers_controller_spec.rb
has_vcards-1.0.0 spec/controllers/has_vcards/phone_numbers_controller_spec.rb
has_vcards-1.0.0.rc0 spec/controllers/has_vcards/phone_numbers_controller_spec.rb