Brian Cardarella
2009-Oct-28 02:39 UTC
[rspec-users] RSpec-Rails not tearing down the session?
I noticed that a session that I am setting up in one exa,ple is still available in another. Is RSpec-Rails supposed to tear down the session or should I be doing this myself?
David Chelimsky
2009-Oct-28 02:45 UTC
[rspec-users] RSpec-Rails not tearing down the session?
On Oct 27, 2009, at 9:39 PM, Brian Cardarella <bcardarella at gmail.com> wrote:> I noticed that a session that I am setting up in one exa,ple is still > available in another. Is RSpec-Rails supposed to tear down the session > or should I be doing this myself?Unless you''ve got a before(:all) block, you should be getting a fresh session in each example, in which case you''ve probably uncovered a bug.
Brian Cardarella
2009-Oct-28 02:53 UTC
[rspec-users] RSpec-Rails not tearing down the session?
I''ve isolated the code pretty well. The session is being set with Authlogic, not certain if that makes a difference. The session hash is empty on the test side but populated in the controller when it shouldn''t be. On Oct 27, 10:45?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Oct 27, 2009, at 9:39 PM, Brian Cardarella <bcardare... at gmail.com> ? > wrote: > > > I noticed that a session that I am setting up in one exa,ple is still > > available in another. Is RSpec-Rails supposed to tear down the session > > or should I be doing this myself? > > Unless you''ve got a before(:all) block, you should be getting a fresh ? > session in each example, in which case you''ve probably uncovered a bug. > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
Brian Cardarella
2009-Oct-28 04:19 UTC
[rspec-users] RSpec-Rails not tearing down the session?
So I think that this is an Authlogic issue, not a RSpec-Rails issue. I''ll keep digging and if I find a fix I''ll update On Oct 27, 10:53?pm, Brian Cardarella <bcardare... at gmail.com> wrote:> I''ve isolated the code pretty well. The session is being set with > Authlogic, not certain if that makes a difference. > > The session hash is empty on the test side but populated in the > controller when it shouldn''t be. > > On Oct 27, 10:45?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Oct 27, 2009, at 9:39 PM, Brian Cardarella <bcardare... at gmail.com> ? > > wrote: > > > > I noticed that a session that I am setting up in one exa,ple is still > > > available in another. Is RSpec-Rails supposed to tear down the session > > > or should I be doing this myself? > > > Unless you''ve got a before(:all) block, you should be getting a fresh ? > > session in each example, in which case you''ve probably uncovered a bug. > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
Brian Cardarella
2009-Oct-28 12:35 UTC
[rspec-users] RSpec-Rails not tearing down the session?
So the problem I was having was because I had a before_filter that was disabling the magic states for a specific action. I resolved the problem by changing this to an around filter: before: def disable_magic_states UserSession.disable_magic_states = true end after: def temporarily_disable_magic_states UserSession.disable_magic_states = true yield UserSession.disable_magic_states = false end That fixed it. Kind of a unique problem but if it hopefully it will save somebody else some time. - Brian On Oct 28, 12:19?am, Brian Cardarella <bcardare... at gmail.com> wrote:> So I think that this is an Authlogic issue, not a RSpec-Rails issue. > I''ll keep digging and if I find a fix I''ll update > > On Oct 27, 10:53?pm, Brian Cardarella <bcardare... at gmail.com> wrote: > > > > > I''ve isolated the code pretty well. The session is being set with > > Authlogic, not certain if that makes a difference. > > > The session hash is empty on the test side but populated in the > > controller when it shouldn''t be. > > > On Oct 27, 10:45?pm, David Chelimsky <dchelim... at gmail.com> wrote:> On Oct 27, 2009, at 9:39 PM, Brian Cardarella <bcardare... at gmail.com> ? > > > wrote: > > > > > I noticed that a session that I am setting up in one exa,ple is still > > > > available in another. Is RSpec-Rails supposed to tear down the session > > > > or should I be doing this myself? > > > > Unless you''ve got a before(:all) block, you should be getting a fresh ? > > > session in each example, in which case you''ve probably uncovered a bug. > > > _______________________________________________ > > > rspec-users mailing list > > > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users