givery-technology / sample-test

13 stars 23 forks source link

TypeError: Cannot read property 'indexOf' of undefined #16

Closed Epiju closed 9 years ago

Epiju commented 9 years ago

Hello,

I am trying to implement the API with Ruby on Rails. I have a problem with the Reserve part.

I have this error:

1) With company user can not reserve event.:
     TypeError: Cannot read property 'indexOf' of undefined
      at Context.<anonymous> (users_reserve.spec.js:83:8)

I don't understand. The login and events parts passed the tests.

In my rails console I see the login calls but there is no reserve call for this test.

Could you help me?

https://github.com/Epiju/sample-test

NckHmml commented 9 years ago

I actually had the same problem when implementing the API with C#.NET But after I fixed it and finish the API, I never been able to reproduce the error.

How I fixed it was somewhat similar as with the changes on here https://github.com/NckHmml/sample-test (I do not have the original fix I had, sorry) Please tell me if it works, so I can make a pull request out of it.

(sidenote: I am not a staff member)

Epiju commented 9 years ago

Hello!

Did you have this error for the same call (User Reserve)? Did you remember which part you have fixed?

Thank you!

NckHmml commented 9 years ago

The only thing I did was moving the declaration of the host variable up by a scope, the same as I did in the fork I linked (The error occurred on multiple places for me)

Epiju commented 9 years ago

Oh ok, I just saw that, sorry!

I think I will fixed it in my fork too. Thank you :)

shunjikonishi commented 9 years ago

Hi,

I could reproduce this with your implementation. This is a bug of api-first-spec.

I've registered it as a new issue. Maybe I can fix it in a few days.

Thanks.

shunjikonishi commented 9 years ago

Fixed with 0.2.5