On 19 December 2011 21:32, Ants Pants <antsmailingl...@gmail.com> wrote:

>
>
> On 19 December 2011 20:45, Pat Maddox <patmad...@me.com> wrote:
>
>> On Dec 19, 2011, at 11:00 AM, Ants Pants wrote:
>>
>> > This could just be my lack of knowledge of how Rails works but from the
>> following code in my RSpec test ....
>> >
>> > $stderr.puts "BEFORE:
>> #{@invitation.meeting.event.event_type.event_type_time_units.inspect}"
>>
>> Can you please share your RSpec code that doesn't do what you expect it
>> to?
>>
>> Pat
>> _______________________________________________
>> rspec-users mailing list
>> rspec-users@rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
>>
>
> I've added the necessary code. I've shown that before the save! the
> event_type.event_type_time_units association returns data (from a Factory
> build). After the save!, EventTypeTimeUnit.all shows that the data is in
> the DB and all keys look okay, I've then whacked in two puts; the first
> showing that event_type returns the correct id; and the second puts returns
> an empty list.
>
> This is simply in an it block with nothing special going on. The code is
> in the order as it's in the block. Nothing going on in between.
>
> It's not an RSpec problem (I don't think) It's just running in that
> environment.
>
> Thanks for taking an interest but to be honest, dont waste any time on it,
> I'll sort it out. But to me, it's a strange one!!
>
> -ants
>
>
>
In the end, I just used #reload to reload the attributes from the DB and it
works. Should I have to do this, I don't know, but my test is now passing.

-ants
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to