givery-technology / sample-test

13 stars 23 forks source link

Company events spec needs fixtures #7

Closed sainies closed 9 years ago

sainies commented 9 years ago

In the company_event_specs

The "From 2015-05-01", "Specify offset" and "Specify offset and limit" tests, should include fixtures that insert attends data into the database, before the tests run. Otherwise there is no data to when running these tests. The "From 2015-04-01" test does include this fixture.

it("From 2015-04-01", function(done) {
   fixtures.create({
      "attends": [{
        "user_id": 1,
        "event_id": 1
      }, {
        "user_id": 2,
        "event_id": 1
      }]
...
shunjikonishi commented 9 years ago

@sainies

No. These test doesn't require any fixtures.

The problem is in your code(SQL).
I guess you use inner join to join events and attends.
But in this case you have to use outer join.

Best.

Shunji

sainies commented 9 years ago

Yes, you are right, the test don't require any fixtures. I was assuming the list would show only events having one or more attendees.