not working with riot correctly? #80

Closed
nbolt opened this Issue Sep 18, 2011 · 8 comments

Projects

None yet

3 participants

@nbolt
nbolt commented Sep 18, 2011

simplecov results: http://stuff.saikonet.org/images/misc/2011-09-18-150129_1024x768_scrot.png

my tests:

context 'New user visits web site' do
    base_uri 'http://localhost:3001'
    get '/'
    asserts_status.equals(200)
end
context 'Authentication' do
    context 'User signs up' do
      base_uri 'http://localhost:3001'
      post '/site/authenticate', body: { user: { email: 'saiko_chriskun@shortmail.com', password: 'my_pass' } }
      asserts_status.equals(200)
      asserts('display tasks') { response.body.match(/New Task/) != nil }
    end

    context 'User signs in' do
       base_uri 'http://localhost:3001'
       post '/site/authenticate', body: { user: { email: 'saiko_chriskun@shortmail.com', password: 'my_pass' } }
       asserts_status.equals(200)
       asserts('display tasks') { response.body.match(/New Task/) != nil }
     end
    context 'User tries to signup with existing email' do
       base_uri 'http://localhost:3001'
       post '/site/authenticate', body: { user: { email: 'saiko_chriskun@shortmail.com', password: 'incorrect_pass' } }
       asserts_status.equals(200)
       asserts('display flash message') { response.body.match(/taken!/) != nil }
     end
end
@colszowka
Owner

I haven't tried SimpleCov with riot yet, but there's no reason it shouldn't work. I'll try it out. Maybe this is related to the bug in the Coverage lib as figured out in #60.

@nbolt
nbolt commented Sep 19, 2011

yeah I think it's the Coverage lib as cover_me is churning out the same results :P

@colszowka
Owner

@saiko-chriskun Could you please edit your issue description to hold the code sample you had posted on StackOverflow as it seems the question is no longer present there and I wanted to provide Ruby core maintainers with this example on my already filed bug report on this: http://redmine.ruby-lang.org/issues/5333

@nbolt
nbolt commented Sep 20, 2011

updated

@nbolt
nbolt commented Sep 23, 2011

not sure what changed exactly but it's not catching any of my controller code now (it doesn't detect any files under the controller tab) although the models seem to be fine.

@colszowka
Owner

Thanks for the report. I'm not using riot so I didn't realize the problem yet.

It would be great if you could create a cucumber feature and example that tests usage with the riot framework similar to those already existing and submit it as a Pull Request so I could go about fixing those.

Also, this might be related to #60.

@ghost
ghost commented Feb 13, 2012

I'm not having any trouble using it with Riot... Although, I was.

I'm trying to remember how I fixed it. I think what I actually ended up with was this: https://gist.github.com/1814276

Again, I'm fuzzy on the whole "fix". But I think it's the rand(99999) part that is the key. Somehow it allows the results to accumulate, otherwise each set of tests overwrites the previous set of results. Using a random name prevents the overwriting. (Well it actually just makes the odds 1:99999.) What you're probably encountering is your model tests being run after your controller tests, so the controller test coverage results get overwritten.

And yeah I'm pretty sure it's related to #60

@bf4
Collaborator
bf4 commented May 17, 2015

Closing as stale. Please reopen if this is still an issue. (And take a look at #340 )

@bf4 bf4 closed this May 17, 2015
@bf4 bf4 locked and limited conversation to collaborators May 17, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.