Bryan,

   I need to pair with you or Pete on this to get this exactly the AV way with the syntax as you prefer. Whenever either of you is available- I shall be doing HOA today Wedn.

Regards,

Viv


On Tuesday, April 22, 2014 12:52 AM, Bryan Yap <notifications@github.com> wrote:
 
In spec/controllers/posts_controller_spec.rb:
> +
> +    it 'does not call the set_post method ' do
> +      controller.should_not_receive(:set_post)
> +      get :index, {}
> +    end
> +  end
> +
> +  describe 'GET show' do
> +
> +    it 'does not call the authenticate method' do
> +      controller.should_not_receive(:authenticate)
> +      get :show, {id: '3'}
> +    end
> +
> +    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 
a better test would be that it checks that @post is assigned the result of Post.find. Doing it this way means you have to test set_post but generally we do not test private methods.
Also when writing the test description, we in AV usually start with "should" instead of "does". If it is not too much of a hassle, could you replace it so that it is consistent with the rest of our work? A quick find & replace should do the trick =)
—
Reply to this email directly or view it on GitHub.