Bryan,

  This is the way Jon showed me to test this controller. You and I need to pair if this is not the standard way AV implements controller tests. Let me know when you are available. 
   Early am (my time)is fine for me if that works best for you. I understand this needs to get done.

Viv


On Tuesday, April 22, 2014 12:54 AM, Bryan Yap <notifications@github.com> wrote:
 
In spec/controllers/posts_controller_spec.rb:
> +    it 'does call the set_post method ' do
> +      controller.should_receive(:set_post) # calls set_post but then does NOT RUN IT. Should_receive is STUB & ASSERTION
> +      get :show, {id: '10'} #:id => '3'id: '3'
> +    end
> +  end
> +
> +  describe 'GET new' do
> +    before(:each) { http_login('admin', 'secret') }
> +
> +    it 'does call the authenticate method' do
> +      controller.should_receive(:authenticate)
> +      get :new, {}
> +    end
> +
> +    it 'does not call the set_post method ' do
> +      controller.should_not_receive(:set_post) # calls set_post but then does NOT RUN IT. Should_receive is STUB & ASSERTION 
there is no need to test for not calling a method. Otherwise, there are a million other methods we could be testing for it to not call =)
—
Reply to this email directly or view it on GitHub.