summaryrefslogtreecommitdiff
path: root/spec/unit/controllers/timesheet.rb
blob: 247e59d7078e2d274753a639962967ac24c77305 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
describe TimesheetController do
  before do
    @repository = fake
    @sut = TimesheetController.new(@repository)
  end
  describe "when loading all timesheets" do
    it "should return all the timesheets" do
      @results[0].must_equal(@timesheet)
    end
    before do
      timesheets = []
      @timesheet = fake
      timesheets << @timesheet
      @repository.stub(:find_all).with(Timesheet).and_return(timesheets)
      @results = @sut.index
    end
  end
end