Diego Mota

Joined

1,160 Experience
11 Lessons Completed
0 Questions Solved

Activity

Hi there, this my first question =), am so happy!.... =)

I have a this:

RSpec.describe Api::V1::Controller, type: :request do
  describe 'on initialize' do
    let(:thing) { FactoryBot.create(:thing, :trait) }

    before { sign_in }

    it 'is named' do
      get '/api/v1/controller#index'
      expect(@controller.view_assigns["name_of_the_thing"]).not_to be_empty
    end
  end
end

I know controller_assigns is not correct, I know assigns is deprecated, I know about instance_variables but they do not find what I look for, I need the variables in the controller managed by the index method, I do not know how to get them. I cannot add gems.

Thank you guys, please correct me, in the way of ask or stuff, thank you so much! =)

Posted in Testing External APIs with VCR Discussion

This is great Chris, thank you! =)...