Sha256: 78dd86d959aa8721172aacb9df12781cf5e58dfbd3f786f3d08de3bc96e6ac12

Contents?: true

Size: 873 Bytes

Versions: 7

Compression:

Stored size: 873 Bytes

Contents

require 'rails_helper'

describe MessageTrain::ParticipantsController do
  include_context 'loaded site'
  include ControllerMacros
  routes { MessageTrain::Engine.routes }

  before do
    login_user first_user
  end

  describe "GET #index" do
    before do
      get :index, box_division: 'in', format: :json
    end
    it_should_behave_like 'a successful page', which_renders: 'index'

    context 'loads participants into @participants' do
      subject { assigns(:participants) }
      its(:first) { should be_a User }
    end
  end

  describe "GET #show" do
    before do
      get :show, box_division: 'in', id: first_user.id, format: :json
    end
    it_should_behave_like 'a successful page', which_renders: 'show'

    context 'loads participant into @participant' do
      subject { assigns(:participant) }
      it { should eq first_user }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
message_train-0.1.6 spec/controllers/message_train/participants_controller_spec.rb
message_train-0.1.5 spec/controllers/message_train/participants_controller_spec.rb
message_train-0.1.4 spec/controllers/message_train/participants_controller_spec.rb
message_train-0.1.3 spec/controllers/message_train/participants_controller_spec.rb
message_train-0.1.2 spec/controllers/message_train/participants_controller_spec.rb
message_train-0.1.1 spec/controllers/message_train/participants_controller_spec.rb
message_train-0.1.0 spec/controllers/message_train/participants_controller_spec.rb