Hi all,
Below is my model action.
def activate!
self.update_attribute(:active, true)
end
here is spec/models/user_spec.rb
describe User do
before(:each) do
@user=User.new(:email=>'k...@gmail.com',:password='1234',)
end
This is my spec.
it "should activate the user" do
@user.a
Kaleem Ullah wrote:
Scott Taylor wrote:
You could benefit from a factory / data builder. See
FixtureReplacement, Fixjour, Factory girl, one of the many others out
there which would build this stuff *once* for you.
I am in need of such data builders.
I recently thumped the square peg of
On Wed, Feb 11, 2009 at 2:52 PM, nat...@pivotalsf.com wrote:
> On Feb 10, 8:49 pm, David Chelimsky wrote:
>> On Tue, Feb 10, 2009 at 2:02 PM, Nathan Wilmes
>> wrote:
>> > (4) assigns(:xxx) will give really bad errors if your class doesn't happen
>> > to define == in such a way that it can equat
On Sat, Feb 7, 2009 at 12:06 PM, Fernando Perez wrote:
>
>> So I uninstalled rcov, and installed instead: spicycode-rcov, but now it
>> cannot find the binary file. Using spicycode do I need to make any tweak
>> to a rake file?
>
> I finally got everything working with no bugs by doing:
>
> 1) git
On Wed, Feb 11, 2009 at 2:52 PM, nat...@pivotalsf.com wrote:
> On Feb 10, 8:49 pm, David Chelimsky wrote:
>> On Tue, Feb 10, 2009 at 2:02 PM, Nathan Wilmes
>> wrote:
>> > (2) The render override for RSpec controllers only takes one argument.
>> > This
>> > means that any controller using two
On Fri, Feb 6, 2009 at 3:12 PM, Alex wrote:
> Hi all, when I spec the to_xml function like this:
> @some_model.should_receive(:to_xml), it dskips the code located in the
> block, here is the controller code:
>
> ...
> output = @detenteur.to_xml( :skip_types => false, :skip_instruct =>
> true, :das
On Wed, Feb 11, 2009 at 2:52 PM, nat...@pivotalsf.com wrote:
> On Feb 10, 8:49 pm, David Chelimsky wrote:
>> On Tue, Feb 10, 2009 at 2:02 PM, Nathan Wilmes
>> wrote:
>> > (3) with_tag is completely broken, as it tries to use the outer class as
>> > the
>> > subject of 'with_tag', rather than t
It works thanks for the hints
Rémi
On Wed, Feb 11, 2009 at 8:21 PM, Pat Maddox wrote:
> On Sat, Feb 7, 2009 at 3:47 AM, rgagnon wrote:
> > I have this and I want to mock the to_xml but not his block cause this
> > is what I want to spec. Is there a way to do this?
>
> Use and_yield to yield a
Thank you David,
You are right we are dealing with some code that need to be refactored.
We will dig deeper to have more info about this Callbackchain problem
Rémi
On Wed, Feb 11, 2009 at 12:05 AM, David Chelimsky wrote:
> On Tue, Feb 10, 2009 at 9:03 AM, Remi Gagnon wrote:
> > Hi guys,
> >
>
On Sat, Feb 7, 2009 at 3:47 AM, rgagnon wrote:
> I have this and I want to mock the to_xml but not his block cause this
> is what I want to spec. Is there a way to do this?
Use and_yield to yield an object, and you can set expectations on it.
For example:
xml_detent = mock('xml detenteur')
xml_
On Wed, Feb 11, 2009 at 6:52 AM, James Byrne wrote:
> Further, by its very nature, a tool is used by vastly more people than
> those that create the tool, otherwise it has little value. The idea
> that a large number of people should be inconvenienced in order that a
> few people are not strikes
Snipping down to relevant questions:
On Feb 10, 8:49 pm, David Chelimsky wrote:
> On Tue, Feb 10, 2009 at 2:02 PM, Nathan Wilmes wrote:
> > (2) The render override for RSpec controllers only takes one argument. This
> > means that any controller using two argument forms will fail.
>
> > Our b
On 11 Feb 2009, at 16:53, James Byrne wrote:
David Chelimsky wrote:
I explained my position in another post in this thread, and I look
forward to your *respectful* responses to those thoughts.
I regret if my initial observation was taken as anything other than
that, an observation. One mig
I would highly recommend you take a look at Celerity
(http://celerity.rubyforge.org/) as well.
The Culerity gem has made it easy to run Celerity (using jruby)
alongside your normal ruby app.
http://upstream-berlin.com/2009/01/28/culerity-full-stack-rails-testing-with-cucumber-and-celerity/
S
Scott Taylor wrote:
> On Feb 11, 2009, at 8:51 AM, Kaleem Ullah wrote:
>
>>@user=User.new
>>@user.active= '1'
>>@user.reset_password_token= ''
>> end
>
> You could benefit from a factory / data builder. See
> FixtureReplacement, Fixjour, Factory girl, one of the many others out
> th
Nick Hoffman wrote:
> To spec your #activate! , why not do something like this?:
>
> it 'should activate the user' do
>@user.active.should be_false
>@user.activate!
>@user.active.should be_true
> end
>
>
Thanks for your reply Hoffman :)
I did the same but it gives error like "#230
On Feb 11, 2009, at 10:53 AM, James Byrne wrote:
David Chelimsky wrote:
I explained my position in another post in this thread, and I look
forward to your *respectful* responses to those thoughts.
I regret if my initial observation was taken as anything other than
that, an observation. On
James Byrne wrote:
> I recently installed nakajima-acts_as_fu (0.0.3) gem. This provides a
> rather painless way of specifying ActiveRecord model schemata on the fly
> in your specifications. You might find it helpful to look into this.
>
> You will discover that some people favour mocks and
Scott Taylor wrote:
> On Feb 11, 2009, at 8:51 AM, Kaleem Ullah wrote:
>
>>@user=User.new
>>@user.active= '1'
>>@user.reset_password_token= ''
>> end
>
> You could benefit from a factory / data builder. See
> FixtureReplacement, Fixjour, Factory girl, one of the many others out
> th
On 10/02/2009, at 10:09 PM, James Byrne wrote:
Zach Dennis wrote:
On Tue, Feb 10, 2009 at 6:22 PM, James Byrne
wrote:
David Chelimsky wrote:
please use "should be >=" as "should >=" will eventually be
deprecated
and removed.
Removed? You are not seriously contemplating forcing people
David Chelimsky wrote:
> On Tue, Feb 10, 2009 at 5:24 PM, James Byrne
> wrote:
>> t.rcov_opts << r_rcov_opta
>>
>> sigh...
>
> Sorry - not following - does this mean you solved the problem?
Yes, a beginners error I am afraid.
a = [1, 2]
b = a
b << [3,4]
a => [1,2,3,4]
--
Posted via h
On Feb 11, 2009, at 8:51 AM, Kaleem Ullah wrote:
Hi,
I am quite new to Rspec. I want to use Rspec to test my existing
Code. I
start from Models (Unit Testing). Here i want your help on a issue.
Here is model/user_spec.rb
describe User do
before(:each) do
@user=User.new
@user.id='2
On 11/02/2009, at 8:51 AM, Kaleem Ullah wrote:
Hi,
I am quite new to Rspec. I want to use Rspec to test my existing
Code. I
start from Models (Unit Testing). Here i want your help on a issue.
Here is model/user_spec.rb
describe User do
before(:each) do
@user=User.new
@user.id='2'
David Chelimsky wrote:
>
> I explained my position in another post in this thread, and I look
> forward to your *respectful* responses to those thoughts.
I regret if my initial observation was taken as anything other than
that, an observation. One might consider it the textual equivalent to a
On Wed, Feb 11, 2009 at 8:52 AM, James Byrne wrote:
> Zach Dennis wrote:
>
>>
>>> Such action causes avoidable and pointless work.
>>
>> And to disprove this argument I will defer to the avoidable and
>> pointless work you will be causing those who maintain the software,
>>
>
> This is a completel
Pat Maddox wrote:
> You have to go through the browser, using something like selenium
> (which can be driven by cucumber)
>
> Pat
Since I only have this one little widget on the page, I was hoping to
avoid selenium for now, but alas. Will give it a go.
Thanks for your thoughts.
Tom
--
Posted v
Okay, thanks. Wanted to check before filing a bug so I'm not throwing
duplicates into the mix.
On Wed, Feb 11, 2009 at 2:56 AM, aslak hellesoy wrote:
> On Wed, Feb 11, 2009 at 2:10 AM, Chris Flipse wrote:
> > This /could/ just a screwy behavior I'm seeing in SQL lite, but I don't
> > think so;
Zach Dennis wrote:
>
>> Such action causes avoidable and pointless work.
>
> And to disprove this argument I will defer to the avoidable and
> pointless work you will be causing those who maintain the software,
>
This is a completely illogical, and inherently contradictory, statement.
The iss
Hi,
I am quite new to Rspec. I want to use Rspec to test my existing Code. I
start from Models (Unit Testing). Here i want your help on a issue.
Here is model/user_spec.rb
describe User do
before(:each) do
@user=User.new
@user.id='2'
@user.email='k...@gmail.com'
@user.password
On Sat, Jan 31, 2009 at 12:45 AM, jschank wrote:
> Hello,
> I recently unpacked the latest (1.1.12) rspec and rspec rails in my
> applicaiton.
Manually? Or using "rake gems:unpack"?
> When I run my specs I get:
>
> config.gem: Unpacked gem rspec-1.1.12 in vendor/gems has no
> specification file.
On 11 Feb 2009, at 09:38, Lucas Florio wrote:
Hi everyone, I am Lucas and I am starting to use cucumber in project.
I need to write a scenario that is little bit complex.
Lets suppose I have a Thing and then I need to advance that Thing
through 4 stages (something like 'import', 'validatio
On Wed, Feb 11, 2009 at 3:38 AM, Lucas Florio wrote:
> Hi everyone, I am Lucas and I am starting to use cucumber in project.
>
> I need to write a scenario that is little bit complex.
>
> Lets suppose I have a Thing and then I need to advance that Thing through 4
> stages (something like 'import'
Hi everyone, I am Lucas and I am starting to use cucumber in project.
I need to write a scenario that is little bit complex.
Lets suppose I have a Thing and then I need to advance that Thing through 4
stages (something like 'import', 'validation', 'authorization', 'export').
Every stage is a spe
On Wed, Feb 11, 2009 at 2:10 AM, Chris Flipse wrote:
> This /could/ just a screwy behavior I'm seeing in SQL lite, but I don't
> think so; normal scenarios are doing this just fine.
>
> I'm playing with the Background feature in the .1.99 beta, and it looks like
> it's being run before every featu
34 matches
Mail list logo