Re: [rspec-users] How to do controller.stub(:some_method) at request test when using rspec2

2011-03-10 Thread Jiang Guimin
Kenrick Chien wrote in post #986591:
> pass the controller name, without quotes:
>   describe DynamicFlowsController
>
> then
>   controller.stub
>
> should work, and then you can refactor the dependency on save_u_and_node
> later.
>
> Ken


Thanks, it's work now! But I can't get the controller object for
integration test.

-- 
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


[rspec-users] unless filter

2011-03-10 Thread Shamaoke
Hi.

Why doesn't the following filter work?

~~~
# encoding: utf-8
# ./example_spec.rb

RSpec.configure do |config|
  config.filter = {
unless: :condition_acceptable
  }
end

describe 'some code' do
  it 'does one', if: :condition_acceptable do
  end

  it 'does two', unless: :condition_acceptable do
  end
end
~~~

~~~
$ rspec example_spec.rb
No examples were matched # instead of 'some code does two'
~~~

Thanks.

Debian GNU/Linux 5.0.7;
Ruby 1.9.2;
RSpec 2.5.0.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


[rspec-users] Good tutorial for RSpec With Rails 3

2011-03-10 Thread Mohnish J.
Hi,

I am looking for a good free tutorial which implements RSpec with Rails
3. I have found many tutorials which work for Rails 2.x but leads you
into issues when trying the same in Rails 3. Rspec Gem also has updated
, coming off the age.. Leading into compatibility issues.

I am able to setup RSpec in my app but I can't fix issues I am getting
into. Its like i am implementing a customized app without get an overall
idea of what changes I would have to carefully incorporate due to usage
of the latest Rails ( say 3.0 ) and the latest RSpec gem 2.5. I am also
making use of rspec-rails 2.5 gem.

Such tutorials( based on earlier versions of Rails and Rspec ) I have
seen so far include:

http://fr.ivolo.us/posts/rspec-tutorial-part-2-a-simple-test

http://blog.davidchelimsky.net/2007/05/14/an-introduction-to-rspec-part-i/

I am unable to find Part 2 of David's tutorial also. I wonder where I
could find that.

I also have seen a similar questions on stackoverflow.com like:-

Rails: Good Rspec2 example usage? (Also: Cucumber, Pickle, Capybara)

The only free tutorial relevant to Rspec with Rails 3 that I could find
so far is:-

http://ruby.railstutorial.org/ruby-on-rails-tutorial-book

I am using ruby 1.9.2 and rails 3.0.3 along with Ubuntu 10.04 .

Thanks for any suggestions you can help me with.

-- 
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


[rspec-users] How to use rspec_scaffold generator with latest rspec gem.

2011-03-10 Thread Mohnish J.
Hi,

I am a newbie to Rails 3 and Rspec. Kindly excuse my being a novice.

I am trying to use RSpec with Rails 3. I am using rails 3.0.3 and ruby
1.9.2 on ubuntu 10.04 os.

I am currently referring to the tutorial on :-
http://www.railsfire.com/article/rspec-behaviour-driven-development-testing-framework.
This tutorial not only uses old plugins , but old Rails version of 2.x
also.

I am unable to use the old rspec generator ( rspec_scaffold ) with rspec
2.5 and rspec-rails 2.5 gem. As expected I get the following error as
given below.

mohnish@mohnish-desktop:~/rails_testing/10Mar11/rspec_demo3$ rails g
rspec_scaffold post title:string body:text
Could not find generator rspec_scaffold.
mohnish@mohnish-desktop:~/rails_testing/10Mar11/rspec_demo3$

Could you please tell me how should I give to accordingly for it to work
for me using the above RoR configuration.

Thanks

-- 
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


[rspec-users] Issues implementing Rspec with Rails3 from tutorial

2011-03-10 Thread Mohnish J.
Hi,


I am a newbie to Rails 3 and Rspec. Kindly excuse my being a novice.

I am trying to implement RSpec with Rails 3. I am using Rails 3.0.3 with
Ruby 1.9.2 on Ubuntu 10.04 os. I am using rspec 2.5 gem and rspec-rails
2.5 gem.

I am referring to the following tutorial:-

http://www.railsfire.com/article/rspec-behaviour-driven-development-testing-framework

This tutorial is implemented on Rails 2.x with an older version of rspec
and rspec-rails.

I tried to implement ***exactly the same tutorial*** with my
configuration, but I have run into some issues. I am unable to figure
out what I must have done wrong.

I am sure about one thing that I am not using the `rails_scaffold`
generator as used in this tutorial. Instead of using the
`rails_scaffold` generator, I made use of the following command `rails g
scaffold post title:string body:text`
 I don't seem to have it(rspec_scaffold) in my list of generators which
as part of Rails 3 and the additional ones that will come with Rspec.

The error I am getting is :-

mohnish@mohnish-desktop:~/rails_testing/10Mar11/rspec_demo5$ rake
spec
(in /home/mohnish/rails_testing/10Mar11/rspec_demo5)
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]

(See full trace by running task with --trace)
mohnish@mohnish-desktop:~/rails_testing/10Mar11/rspec_demo5$ rake
spec --trace
(in /home/mohnish/rails_testing/10Mar11/rspec_demo5)
** Invoke spec (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]

/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/railties/databases.rake:429:in
`block (3 levels) in '
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in
`call'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in
`block in execute'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in
`each'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in
`execute'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:597:in
`block in invoke_with_call_chain'
/home/mohnish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in
`mon_synchronize'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:607:in
`block in invoke_prerequisites'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:604:in
`each'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:604:in
`invoke_prerequisites'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:596:in
`block in invoke_with_call_chain'
/home/mohnish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in
`mon_synchronize'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:583:in
`invoke'

/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.3/lib/active_record/railties/databases.rake:460:in
`block (3 levels) in '
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in
`call'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:636:in
`block in execute'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in
`each'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:631:in
`execute'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:597:in
`block in invoke_with_call_chain'
/home/mohnish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in
`mon_synchronize'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:607:in
`block in invoke_prerequisites'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:604:in
`each'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:604:in
`invoke_prerequisites'
/home/mohnish/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:596:in
`block in invoke_with_call_chain'
/home/mohnish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in
`mon_synchronize'
/home/mohnish/.rvm/gems/ruby-1.9.2

Re: [rspec-users] How to use rspec_scaffold generator with latest rspec gem.

2011-03-10 Thread David Chelimsky

On Mar 10, 2011, at 7:49 AM, Mohnish J. wrote:

> Hi,
> 
> I am a newbie to Rails 3 and Rspec. Kindly excuse my being a novice.
> 
> I am trying to use RSpec with Rails 3. I am using rails 3.0.3 and ruby
> 1.9.2 on ubuntu 10.04 os.
> 
> I am currently referring to the tutorial on :-
> http://www.railsfire.com/article/rspec-behaviour-driven-development-testing-framework.
> This tutorial not only uses old plugins , but old Rails version of 2.x
> also.
> 
> I am unable to use the old rspec generator ( rspec_scaffold ) with rspec
> 2.5 and rspec-rails 2.5 gem. As expected I get the following error as
> given below.
> 
>mohnish@mohnish-desktop:~/rails_testing/10Mar11/rspec_demo3$ rails g
> rspec_scaffold post title:string body:text
>Could not find generator rspec_scaffold.
>mohnish@mohnish-desktop:~/rails_testing/10Mar11/rspec_demo3$
> 
> Could you please tell me how should I give to accordingly for it to work
> for me using the above RoR configuration.

rails generate rspec:install
rails generate scaffold

In Rails 3, once you run the rspec:install generator, the Rails generators 
delegate out to rspec-rails to generate the spec files.

You might also want to check out http://ruby.railstutorial.org/.

Cheers,
David


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


Re: [rspec-users] How to use rspec_scaffold generator with latest rspec gem.

2011-03-10 Thread Pixel
On Thu, Mar 10, 2011 at 7:49 AM, Mohnish J.  wrote:

> I am unable to use the old rspec generator ( rspec_scaffold ) with rspec
> 2.5 and rspec-rails 2.5 gem. As expected I get the following error as
> given below.
>
>    mohnish@mohnish-desktop:~/rails_testing/10Mar11/rspec_demo3$ rails g
> rspec_scaffold post title:string body:text
>    Could not find generator rspec_scaffold.
>    mohnish@mohnish-desktop:~/rails_testing/10Mar11/rspec_demo3$
>
> Could you please tell me how should I give to accordingly for it to work
> for me using the above RoR configuration.
>

Hi Mohnish,

The rails generator script will produce a list of it's generators if
you simply type 'rails g' you can get further assistance by typing
'rails g generator --help'  such as 'rails g scaffold --help'  I
suspect that you are wanting to generate a scaffold with all of the
rspec tests as well, because rails 3 went modular you no longer need a
special command to get rspec tests, simply by installing the gem and
including it in both :development and :test environments in your
Gemfile, your scaffold generator will automatically produce rspec
tests for you.  First check to make sure the rspec:install generator
is listed under 'rails g' and that you have run that generator first,
then you can 'rails g scaffold' and the model/controller/views and
necessary specs will be generated.

Rspec 2 docs are a bit of a work in progress at the moment as I
understand it but there is much to be gleaned from referencing
http://relishapp.com/rspec before you email the list.  Specifically
the rspec-rails section.

Hope that helps,
Cole
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] Good tutorial for RSpec With Rails 3

2011-03-10 Thread Jon Homan
I recommend getting a copy of The RSpec Book (
http://www.pragprog.com/titles/achbd/the-rspec-book). I read through that
when I was fairly new to RSpec and I think it helped ramp up quickly.

Jon Homan


On Thu, Mar 10, 2011 at 5:52 AM, Mohnish J.  wrote:

> Hi,
>
> I am looking for a good free tutorial which implements RSpec with Rails
> 3. I have found many tutorials which work for Rails 2.x but leads you
> into issues when trying the same in Rails 3. Rspec Gem also has updated
> , coming off the age.. Leading into compatibility issues.
>
> I am able to setup RSpec in my app but I can't fix issues I am getting
> into. Its like i am implementing a customized app without get an overall
> idea of what changes I would have to carefully incorporate due to usage
> of the latest Rails ( say 3.0 ) and the latest RSpec gem 2.5. I am also
> making use of rspec-rails 2.5 gem.
>
> Such tutorials( based on earlier versions of Rails and Rspec ) I have
> seen so far include:
>
> http://fr.ivolo.us/posts/rspec-tutorial-part-2-a-simple-test
>
> http://blog.davidchelimsky.net/2007/05/14/an-introduction-to-rspec-part-i/
>
> I am unable to find Part 2 of David's tutorial also. I wonder where I
> could find that.
>
> I also have seen a similar questions on stackoverflow.com like:-
>
> Rails: Good Rspec2 example usage? (Also: Cucumber, Pickle, Capybara)
>
> The only free tutorial relevant to Rspec with Rails 3 that I could find
> so far is:-
>
> http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
>
> I am using ruby 1.9.2 and rails 3.0.3 along with Ubuntu 10.04 .
>
> Thanks for any suggestions you can help me with.
>
> --
> Posted via http://www.ruby-forum.com/.
> ___
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] Rspec single file

2011-03-10 Thread phani kumar
 Hi Guys,

How can run the single spec file without loading the environment.

I know ruby spec commands will load the total environment.

I want to run the files one by one those are not in same folder  and i want
to load test environment once for all 10 files.

Can we run single file through the Rspec:Core:Runner or some other class?

Can you guys please help me?

-Thanks
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Good tutorial for RSpec With Rails 3

2011-03-10 Thread James Martin
I understand you're looking for 'free' tutorials but I would really strongly
advise you check out Michael Hartl's
http://ruby.railstutorial.org/screencast series. I'm not affiliated
with this in any way, but I watched
them recently (more for the Rails 3 info than RSpec) and found the use of
RSpec and test-first development (not /really/ TDD) to be worth the price
alone - there are so many rspec-rails specific gotchas that you just don't
even think about when using naked RSpec.

The screencast + PDF combination represent excellent value for money
(currently $95); which you should easily make back when you deploy your
first killer Rails app. :-)


HTH

James.

On Thu, Mar 10, 2011 at 10:52 PM, Mohnish J.  wrote:

> Hi,
>
> I am looking for a good free tutorial which implements RSpec with Rails
> 3. I have found many tutorials which work for Rails 2.x but leads you
> into issues when trying the same in Rails 3. Rspec Gem also has updated
> , coming off the age.. Leading into compatibility issues.
>
> I am able to setup RSpec in my app but I can't fix issues I am getting
> into. Its like i am implementing a customized app without get an overall
> idea of what changes I would have to carefully incorporate due to usage
> of the latest Rails ( say 3.0 ) and the latest RSpec gem 2.5. I am also
> making use of rspec-rails 2.5 gem.
>
> Such tutorials( based on earlier versions of Rails and Rspec ) I have
> seen so far include:
>
> http://fr.ivolo.us/posts/rspec-tutorial-part-2-a-simple-test
>
> http://blog.davidchelimsky.net/2007/05/14/an-introduction-to-rspec-part-i/
>
> I am unable to find Part 2 of David's tutorial also. I wonder where I
> could find that.
>
> I also have seen a similar questions on stackoverflow.com like:-
>
> Rails: Good Rspec2 example usage? (Also: Cucumber, Pickle, Capybara)
>
> The only free tutorial relevant to Rspec with Rails 3 that I could find
> so far is:-
>
> http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
>
> I am using ruby 1.9.2 and rails 3.0.3 along with Ubuntu 10.04 .
>
> Thanks for any suggestions you can help me with.
>
> --
> Posted via http://www.ruby-forum.com/.
> ___
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Rspec single file

2011-03-10 Thread Ken Chien
I assume you're asking in the context of Rails?

If so, take a look at Spork[1].  You can choose what you want to load once,
and what you want to load before every spec.

Ken
---
[1] https://github.com/timcharper/spork

2011/3/10 phani kumar 

>
>
>  Hi Guys,
>
> How can run the single spec file without loading the environment.
>
> I know ruby spec commands will load the total environment.
>
> I want to run the files one by one those are not in same folder  and i want
> to load test environment once for all 10 files.
>
> Can we run single file through the Rspec:Core:Runner or some other class?
>
> Can you guys please help me?
>
> -Thanks
>
>
>
>
>
>
>
> ___
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] Trying to test flash messaging with rspec

2011-03-10 Thread Tyrel R.
Hello every one,

So my this rspec test fails:

[code]
it "should have a welcome message" do
post :create, :user => @attr
response.flash[:success].should eql("Welcome new user!")
  end
[/code]

However when I create a new user the flash message does display just as
I had wanted it to.

The controller has this in it:
[code]
def create
@user = User.new(params[:user])
if @user.save
  flash[:success] = "Welcome new user!"
  redirect_to @user
else
  @title = "Sign up"
  render 'new'
end
  end

  def show
@user  = User.find(params[:id])
@title = @user.userName
  end
end
[/code]

And the view displays with:
[code]
<%= flash_helper %>

The helper is:

def flash_helper
  f_names = [:success]
  fl = ''

  for name in f_names
if flash[name]
  fl = fl + "#{flash[name]}"
end
  flash[name] = nil;
end
return fl.html_safe
  end
[/code]

Like I said the flash message works just fine however the test fails any
ideas would be greatly appreciated.

Hope all is well :)

-- 
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] How to use rspec_scaffold generator with latest rspec gem.

2011-03-10 Thread Mohnish J.
David Chelimsky wrote in post #986732:
> On Mar 10, 2011, at 7:49 AM, Mohnish J. wrote:
>
>> also.
>> Could you please tell me how should I give to accordingly for it to work
>> for me using the above RoR configuration.
>
> rails generate rspec:install
> rails generate scaffold
>
> In Rails 3, once you run the rspec:install generator, the Rails
> generators delegate out to rspec-rails to generate the spec files.
>
> You might also want to check out http://ruby.railstutorial.org/.
>
> Cheers,
> David

Hi David,

Thank you very much for you reply, I now understand that this isn't 
needed anymore with Rails 3. I had in another post on the same forum 
mentioned about one of your blogs:-

http://blog.davidchelimsky.net/2007/05/14/an-introduction-to-rspec-part-i/.

I am unable to find Part 2 of your tutorial. Could you please tell me 
where could I find the same.

Thanks again..:)

-- 
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] Trying to test flash messaging with rspec

2011-03-10 Thread James Martin
How about just testing the flash directly, which should be accessible from
your test:

flash[:success].should =~ /welcome new user/i

I've used a case insensitive regex here, which I think captures the intent
of your test without being quite so rigid.

What do you think?



On Fri, Mar 11, 2011 at 10:06 AM, Tyrel R.  wrote:

> Hello every one,
>
> So my this rspec test fails:
>
> [code]
> it "should have a welcome message" do
>post :create, :user => @attr
>response.flash[:success].should eql("Welcome new user!")
>  end
> [/code]
>
> However when I create a new user the flash message does display just as
> I had wanted it to.
>
> The controller has this in it:
> [code]
> def create
>@user = User.new(params[:user])
>if @user.save
>  flash[:success] = "Welcome new user!"
>  redirect_to @user
>else
>  @title = "Sign up"
>  render 'new'
>end
>  end
>
>  def show
>@user  = User.find(params[:id])
>@title = @user.userName
>  end
> end
> [/code]
>
> And the view displays with:
> [code]
> <%= flash_helper %>
>
> The helper is:
>
> def flash_helper
>  f_names = [:success]
>  fl = ''
>
>  for name in f_names
>if flash[name]
>  fl = fl + "#{flash[name]}"
>end
>  flash[name] = nil;
>end
>return fl.html_safe
>  end
> [/code]
>
> Like I said the flash message works just fine however the test fails any
> ideas would be greatly appreciated.
>
> Hope all is well :)
>
> --
> Posted via http://www.ruby-forum.com/.
> ___
> rspec-users mailing list
> rspec-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Trying to test flash messaging with rspec

2011-03-10 Thread Tyrel R.
That worked perfectly thank you :)

-- 
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] Good tutorial for RSpec With Rails 3

2011-03-10 Thread Mohnish J.
Hi Jon,

Thanks for your recommendation.

Jon Homan wrote in post #986735:
> I recommend getting a copy of The RSpec Book (
> http://www.pragprog.com/titles/achbd/the-rspec-book). I read through
> that
> when I was fairly new to RSpec and I think it helped ramp up quickly.
>
> Jon Homan

-- 
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] How to use rspec_scaffold generator with latest rspec gem.

2011-03-10 Thread Mohnish J.
Hi Cole,

Thanks for the link and yorr reply. Yep , I did want to generate a 
scaffold with all rspec tests.

Pixel wrote in post #986740:
> On Thu, Mar 10, 2011 at 7:49 AM, Mohnish J. 
> wrote:
>
>> for me using the above RoR configuration.
>>
>
> Hi Mohnish,
>
> The rails generator script will produce a list of it's generators if
> you simply type 'rails g' you can get further assistance by typing
> 'rails g generator --help'  such as 'rails g scaffold --help'  I
> suspect that you are wanting to generate a scaffold with all of the
> rspec tests as well, because rails 3 went modular you no longer need a
> special command to get rspec tests, simply by installing the gem and
> including it in both :development and :test environments in your
> Gemfile, your scaffold generator will automatically produce rspec
> tests for you.  First check to make sure the rspec:install generator
> is listed under 'rails g' and that you have run that generator first,
> then you can 'rails g scaffold' and the model/controller/views and
> necessary specs will be generated.
>
> Rspec 2 docs are a bit of a work in progress at the moment as I
> understand it but there is much to be gleaned from referencing
> http://relishapp.com/rspec before you email the list.  Specifically
> the rspec-rails section.
>
> Hope that helps,
> Cole

-- 
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users


Re: [rspec-users] Good tutorial for RSpec With Rails 3

2011-03-10 Thread Mohnish J.
Hi James,

Thanks for your suggestion.

James Martin wrote in post #986783:
> I understand you're looking for 'free' tutorials but I would really
> strongly
> advise you check out Michael Hartl's
> http://ruby.railstutorial.org/screencast series. I'm not affiliated
> with this in any way, but I watched
> them recently (more for the Rails 3 info than RSpec) and found the use
> of
> RSpec and test-first development (not /really/ TDD) to be worth the
> price
> alone - there are so many rspec-rails specific gotchas that you just
> don't
> even think about when using naked RSpec.
>
> The screencast + PDF combination represent excellent value for money
> (currently $95); which you should easily make back when you deploy your
> first killer Rails app. :-)
>
>
> HTH
>
> James.

-- 
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users