I'm trying to decide how to test a method that simply calculates an average of values on associated records. I'm concerned about testing the implementation vs the actual result returned.

Say I have the following models...

```
class User
  has_many :interviews

  def interview_grade
    interviews.average(:score).round unless interviews.empty?
  end
end

class Interview
  belongs_to :user
end

```

And in `user_spec.rb` I have...

```
describe "interview_grade" do
  let(:user) {User.new}
  context "when the user has interviews" do
    before { user.stub_chain(:interviews, :empty?){false} }
    it "should return an average of the appraisal ratings" do
      user.interviews.should_receive(:average).with(:score).and_return(3.2)
      user.work_history_grade.should == 3
    end
  end

  context "when the user has no interviews" do
    before {Interview.destroy_all}
    it "should return nil" do
      user.interview_grade.should be_nil
    end
  end

end

```

These tests pass but it feels fragile to me. What if `interview_grade` should actually calculate the **sum** of the scores (for example). As I'm just testing that a particular chain of methods is called, this passing test wouldn't tell me that the result is actually incorrect.

I have tried stubbing `user.interviews` in order to setup the available scores for the test to work with but this seems tricky to do in Rails 3 due to the way associations are lazy loaded. i.e. I can't just create an array of Interview objects because it doesn't respond to the average `method`.

Any advice greatly appreciated.