title: rspec doesn't get the right value of the instance var
body: <p>I have a controller action with some instance variables which I want to test, here is my action code:</p>
  
  <pre><code>def index
      @users_list = get_response('accounts/by_tag/QuickcallAdmin')['users'].to_a
      @credit_admin = !@users_list.select{|h| h['email'] == current_user.email}.blank?
      @accounts_emails = Account.pluck(:email)
    end
  </code></pre>
  
  <p>and the spec code:</p>
  
  <pre><code>describe 'GET #index' do
      login_user
      let(:account) {create(:account)}
  
      it 'responds with 200' do
        get :index, :format =&gt; :html
        controller.instance_variable_set(:@users_list, [{"id"=&gt;2, "email"=&gt;"tes1@test.com", "tenant_id"=&gt;1,"first_name"=&gt;"valera","last_name"=&gt;"rotari","phone_number"=&gt;"89439438954", "tags"=&gt;[{"name"=&gt;"Program", "value"=&gt;"my_company"}, {"name"=&gt;"ProgramAdmin", "value"=&gt;"new_program"}, {"name"=&gt;"ProgramAdmin", "value"=&gt;"new_program1"}, {"name"=&gt;"QuickcallAdmin", "value"=&gt;"q1"}, {"name"=&gt;"CreditAdmin", "value"=&gt;"q1"}]}])
  
        expect(assigns(:credit_admin)).to eql(true)
        expect(assigns(:accounts_emails)).to eql(["tes1@test.com"])
      end
    end
  </code></pre>
  
  <p>so as you can see I try to assign some hash which I usually get from the response of the api call, and after that to see if credit_admin and account_emails vars has the right value. The problem is if I pus some puts in spec after var assignation I see my value assigned, but the test fails because credit admin variable is false and is expected as true. I got the same code and put it rails console to make a test for myself, note I use the same hash, and I have the right true value. So it seems like @users_list var is not assigned right or something like this. Also @account_email is empty array, but I have account created from factory, so it should have some value in it, seems like a common problem for both of them</p>