Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7110 (new defect)

Opened 1 year ago

Last modified 1 year ago

[PATCH] Improve Test Coverage for Integration Sessions

Reported by: kevinclark Assigned to: bitsweat
Priority: normal Milestone: 2.x
Component: ActionPack Version: edge
Severity: normal Keywords:
Cc: rick, nzkoz

Description

We're missing a test that checks that named routes aren't reloaded on AC::Integration::Session#reset! if they're already configured. Via heckle (it flipped the unless to an if at that branch):

The following mutations didn't cause test failures:

def reset!

@status = @path = @headers = nil @result = @status_message = nil @https = false @cookies = { } @controller = @request = @response = nil self.host = "www.example.com" self.remote_addr = "127.0.0.1" self.accept = "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" if @named_routes_configured then

klass = class << self

self

end Routing::Routes.named_routes.install(klass) klass.send(:public, *Routing::Routes.named_routes.helpers) @named_routes_configured = true

end

end

Attachments

doesnt_reinstall_named_routes.diff (0.5 kB) - added by kevinclark on 01/17/07 04:06:02.

Change History

01/17/07 04:06:02 changed by kevinclark

  • attachment doesnt_reinstall_named_routes.diff added.

01/17/07 05:18:13 changed by kevinclark

Hold on this one. There's a mocha issue that's boggling my mind. The expectation doesn't appear to go away after the test, which causes some failures in UrlRewriter tests.

Will investigate.

01/17/07 19:21:46 changed by kevinclark

Mocha has acknowledged the problem and there should be a bugfix release soonish. This'll be good to go then.

01/18/07 22:33:20 changed by kevinclark

  • cc set to rick, nzkoz.

Ok, this is good to go with Mocha 0.3.3.

04/30/07 20:41:01 changed by josh

  • keywords set to verified.

07/20/07 03:55:50 changed by mpalmer

  • keywords deleted.

Patch applied with some fuzz. Tests pass, implementation looks good, I can't find any existing test that covers the same ground. +1 from me, more test cases are teh rock.