Hi,
I am trying to run rspec testcase using webrat but it is showing me an
error as "undefined method `last_response' for #"
Following are my configurations:
Gemfile:
roup :development, :test do
gem 'sqlite3-ruby', :require => 'sqlite3'
gem "rspec", "=2.4.0"
gem "rspec-rails", "2.4.0"
#
Hi,
We are using omniauth for signup through Facebook and twitter.
Is there any way i can check this by rspec controllers since it contains
callbacks n all..so i think we may have to use mock models.
If there is any link or documentation please let me know so that i can
start implementing.
--
Pos
Hello,
I had used Fixtures and factory girl for preloading of data in earlier
version rspec.
Is there any new thing for loading of data in rspec 2 or do we have to
use the same.
Also is there any documentation link where i can get nice info about
rspec 2
--
Posted via http://www.ruby-forum.com/.
Hey,
Thanks a lot for the presentation.It was really helpful.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Thanks a lot.Will look into it.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Hi,
I have successfully installed rspec 2 for Rails 3 by visiting the
following link
http://lindsaar.net/2010/4/14/installing_rspec_for_rails_3
In this post it is mentioned taht when i do "rails g rspec:install"
then it should install
exist lib
create lib/tasks/rspec.rake
exist con
Hi,
I am running rspec spec for Rails 3.The version for rspec is 2.4.0
When running the script i am getting output as
User Profile should not be created if name is blank
Failure/Error: @contact_detail.should be_valid
expected valid? to return true, got false
# ./spec/models/merchan
Ok.I will post this topic separately.. :)
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
David Chelimsky wrote:
> On Aug 19, 2010, at 8:57 AM, Amit Kulkarni wrote:
>
>> Amit Kulkarni wrote:
>>> For the application i have written scripts which i am call from a rake
>>> task.
>>> So i need to know whether how much tests have been passed/failed b
David Chelimsky wrote:
> On Aug 18, 2010, at 10:46 AM, Amit Kulkarni wrote:
>
>> Amit Kulkarni wrote:
>>> Hello,
>>> I wanted to know how to load dummy data in the application using Factory
>>> girl.
>>> I had done this using Fixtures.I had made a
Amit Kulkarni wrote:
> For the application i have written scripts which i am call from a rake
> task.
> So i need to know whether how much tests have been passed/failed by
> email.
In the mail i will get the count of total tests passed/failed.
--
Posted via http://www.ru
For the application i have written scripts which i am call from a rake
task.
So i need to know whether how much tests have been passed/failed by
email.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
htt
Amit Kulkarni wrote:
> Hello,
> I wanted to know how to load dummy data in the application using Factory
> girl.
> I had done this using Fixtures.I had made a fixtures folder into the
> test folder and run the command "rake test fixtures:load"
> Currently i tried using
jko170 wrote:
> There is also the excellent email_spec gem:
>
> http://github.com/bmabey/email-spec/
Continuing with the topic but scenario is different:
I had written a rake task in rspec.rake.What i want is after running the
task i should get an email
So for that i have created a method in app
Hello,
I wanted to know how to load dummy data in the application using Factory
girl.
I had done this using Fixtures.I had made a fixtures folder into the
test folder and run the command "rake test fixtures:load"
Currently i tried using factories in the spec which is working fine.
Wanted to know kn
Amit Kulkarni wrote:
> Hello,
> I am currently working on Ubuntu machine in which there is already a
> spec file generated which has some models
> So i just updated by entering the command "ruby script/generate rspec"
> Now when i try to generate rspec model then it show
Hello,
I am currently working on Ubuntu machine in which there is already a
spec file generated which has some models
So i just updated by entering the command "ruby script/generate rspec"
Now when i try to generate rspec model then it shows error as
"The name 'User' is either already used in your
Hello,
I am currently working on Ubuntu machine in which there is already a
spec file generated which has some models
So i just updated by entering the command "ruby script/generate rspec"
Now when i try to generate rspec model then it shows error as
"The name 'User' is either already used in your
Hello all,
I am facing a weird problem.I am just trying to login but after entering
correct parameters it is showing error as invalid username and password.
I think there is some configuration or fixtures problem because if i try
to login from GUI then it is working fine(using same database)
Follow
Hello,
I recently updated rspec-rails from 1.1.12 to 1.3.0 and rspec from
1.1.12 to 1.3.0
Now while running cucumber i am facing a problem.
It says as 'undefined method 'visit''
my cucumber version is 0.3.99 and webrat version is 0.7.0.
Before upgrading the gem it ran well but now above error is
Hello,
I am having some problem with the controllers after i updated my specs.
Following are the details:
I am trying to call create action as
post :create :user => {:name => "abc", :login => "abcd", :phone =>
1}
After this i am searching this for confirmation i.e.
user = User.find_by_name("ab
Amit Kulkarni wrote:
> David Chelimsky wrote:
>> On Mon, Mar 8, 2010 at 1:13 AM, Amit Kulkarni
>> wrote:
>>> As per the list there are 3 versions of rspec released in Jan 2010 i.e.
>>> 1.3.0,1.3.1 and 1.3.2
>>> Also there are various versions starting f
David Chelimsky wrote:
> On Mon, Mar 8, 2010 at 1:13 AM, Amit Kulkarni
> wrote:
>> As per the list there are 3 versions of rspec released in Jan 2010 i.e.
>> 1.3.0,1.3.1 and 1.3.2
>> Also there are various versions starting from 2.
>> So from all above version which
As per the list there are 3 versions of rspec released in Jan 2010 i.e.
1.3.0,1.3.1 and 1.3.2
Also there are various versions starting from 2.
So from all above version which one is a stable one so that i can
install it.
--
Posted via http://www.ruby-forum.com/.
_
Amit Kulkarni wrote:
> Hello all,
> I am facing a strange problem.
> I have generated rspec for a particular project.Similarly created a spec
> controller.Under that controller i have written post :create action
> When i run my spec i get an error as
> "unde
Hello all,
I am facing a strange problem.
I have generated rspec for a particular project.Similarly created a spec
controller.Under that controller i have written post :create action
When i run my spec i get an error as
"undefined method `post' for
#"
Strangely my models are working fine.My rails
Oh ok.
>From your code it seems that we are checking the whole app as you
mentioned.
I have tested controllers using rspec.
So i am not getting which is better to use.
Since with Rspec we test the objects and here using cucumber(good for
writing scenarios and understanding)we are testing the GUI
Hello,
Is there any way to test controllers using cucumber.
I was doing it with rspec but since cucumber's description is good how
can i proceed testing it with cucumber?
For e.g.
I have a scenario of user creation like
Feature: User Scenarios
Scenario: Successfull creation of user
Given a n
Hello all,
I got my problem solved.It was really a simple mistake.
I have a doubt that in development i can send a mail but in while
testing(through Rspec) mail is not getting sent.
Do i need to change some configuration for testing?
--
Posted via http://www.ruby-forum.com/.
_
I got the Notifier model included in the user spec like require
'notifier.rb'
By adding this i can now access Notifier.deliver_signup_notification
method(i checked up in the code and it user deliver before that)
Now i can access the method.
But another problem is i am getting error as "undefined
Hi i am testing email through rspec but some problem occured.
This is the whole scenario:
What i want to do is when my user is created it should send mail to for
activation.
This is the code under user_spec.rb
require File.expand_path(File.dirname(__FILE__) + ‘/../spec_helper’)
def valid_user_attr
Thanks a lot David.
I generated a the output to xls with the command
"spec user_spec.rb --format progress:a.xls"
Under the xls it is displaying only those examples which are failing
like for e.g.
1)
'User User should not be created if email format is different' FAILED
expected: "Please check the
Amit Kulkarni wrote:
> Ok.Thanks a lot David
Hello,
Is there any way to display rspec result in .csv or .xls format.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listi
Nick Hoffman wrote:
> Hey guys. I'm having some trouble with a route spec. In routes.rb , I
> have:
> map.connect 'foods/search/:name', :controller => :foods, :action =>
> :search
>
> foods_controller_spec.rb has: http://codepad.org/dg3FERKw
> Unfortunately, that fails: http://codepad.org/lck4
Ok.Thanks a lot David
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Yes,Thanks a lot Andrew.
The last two lines were not commented in routes.rb
because of that it was matching default.Now i commented out those line
and it was catching if undefined routes are given.
--
Posted via http://www.ruby-forum.com/.
___
rspec-use
Thanks a lot David.
I am now getting familiar with before filters.
I am writing spec without using mocks so i need to just pass the proper
parameter to get pass the filter.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-use
Thanks David.
Also i am little bit confused regarding routes.
Consider a routing example
it "should map { :controller => 'channels', :action => 'new' } to
/channels/new" do
route_for(:controller => "channels", :action => "new").should ==
"/channels/new"
end
Now i can see all the routing meth
Thanks David,
Now in spec when i write login_as :admin then there must be some method
written for login_as?
Now if there are before filters in controller then do we need to write
each and every method or it is indeed taken care of but the developer
and we need to just have to pass the value for
Hello,
I am writing controller specs.I want to know how can i write specs which
invlove before filters in controllers.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/
Hi David,
I have some query regarding running spec command.
When i tried to run normal testcase by command "spec
test_controller_spec.rb"
then that particular test case runs but the routing testcase fails.
Now if i run through the command "spec
spec/controllers/test_controller_spec.rb" then all
Amit Kulkarni wrote:
> Any suggestions on the above topic
Hello,
I want to print my output in an html file.
I am using command rake spec:controllers --format html:result.html from
the root directory
But it is not working.
Please suggest
--
Posted via http://www.ruby-forum.
Amit Kulkarni wrote:
> Ok Fine.That sounds to be a good idea.
> Thanks
Hi David,
Good news,My routing scenarios are working now.
I dont know how but it did.I was going to mail you the app but it is
working fine now.
--
Posted via http://www.ruby-for
Ok Fine.That sounds to be a good idea.
Thanks
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Amit Kulkarni wrote:
> Oh that means if i am using rails version 2.1.2 or more then i need to
> have rspec version 1.1.12.
> In that case i need to remove the latest version and install rspec
> 1.1.12.
> I will do it and update you asap.
> Thanks a lot David.
Hi David,
As per
Oh that means if i am using rails version 2.1.2 or more then i need to
have rspec version 1.1.12.
In that case i need to remove the latest version and install rspec
1.1.12.
I will do it and update you asap.
Thanks a lot David.
--
Posted via http://www.ruby-forum.com/.
___
MY spec helper contains following code:
# This file is copied to ~/spec when you run 'ruby script/generate
rspec'
# from the project root directory.
ENV["RAILS_ENV"] ||= 'test'
require
File.expand_path(File.join(File.dirname(__FILE__),'..','config','environment'))
require 'spec'
require 'webrat'
David Chelimsky wrote:
> On Wed, Nov 11, 2009 at 11:19 PM, Amit Kulkarni
> wrote:
>
>> >>
>> It gets executed but i am not able to see any results as in 2 examples 2
>> passed something like that as it comes normally.
>>
>
> Then how do you know
David Chelimsky wrote:
> On Nov 11, 2009, at 5:58 AM, Amit Kulkarni wrote:
>
>>
>>it "should map { :controller => 'home' } RESTfully" do
>> params_from( :get, '/home' ).should == { :controller => 'home',
&
Any suggestions on the above topic
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Hi David still no success.
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe HomeController, "routes" do
describe "route generation" do
it "should map { :controller => 'home', :action => 'index' } to /home"
do
route_for(:controller => 'home', :action => 'index
Thanks David for the information but still i am getting the same error.
What i have done is:
I have home controller.
now i am writing route scenarios in home_controller_spec.rb which is
under spec/controllers directory
I tried your code which looks like as
describe "route generation", :type => :
Hi all,
I am writing scenarios for testing my routes but it is giving me error
as undefined method `route_for and also for params_from.
Did i miss something which i need to add in my controller
My code is as follows:
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe H
I checked the whole code but there is no error as such.
What i have done is i added a line i.e.
t.spec_opts = ['--format' , 'html:result.html' ] under
/lib/tasks/rspec.rake i.e.
[:models, :controllers, :views, :helpers, :lib, :integration].each do
|sub|
desc "Run the code examples in spec/#{s
Yes i get an error message as rake aborted.
spec/models/survey_spec.rb" --format html:result.html failed
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
My spec.opts file contains
--colour
--format html:spec/a.html
--loadby
mtime
--reverse
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Hello,
I had written some model scenarios.
Now i want to generate that output in an html file.
i am executing the models using rake i.e. rake spec:models from spec
directory.
But the html file is not getting generated.
Following is the error trace:
** Invoke spec:models (first_time)
** Invoke db:t
Following is the scenario.
describe BbPostsController, "POST Create" do
context "Admin" do
fixtures :users, :bb_posts, :user_channels, :channels,
:channel_features
it "should save post" do
login_as(:amit)
# Added to pass before filters in controller
controller.s
I am trying to write controller spec but i am getting some problem.
Following is the controller code:
def create
@bb_post = @feature.posts.new( params[ :bb_post ] )
if @bb_post.save
flash[ :notice ] = 'Blog post was successfully created.'
format.html { redirect_to( blog_bb_p
Hello,
Any updates on the above topic
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Carlos Souza wrote:
> Amit,
>
> Your controller spec that you said was working was not actually testing
> your
> controller since you were not calling any of your controller methods.
Ok.In that case can you suggest how to call controller methods from the
uppermost code which is running fine an
Hello everybody,
I had written same scenario using normal code which is as follows :
def valid_attributes
{
:body => "test_description",
:title => "test123",
}
end
describe BbPostsController, "POST Create" do
before(:each) do
@post = BbPost.new
end
context "Admin" do
fixt
Even if we are using mocks and if our models are changed then also we
need to change our spec.
Same for if we don't use mocks.
So same question i am asking Are mocks really useful?
Also When to use if at all we want to use?
I searched on net regarding the same but till now no success :-)
Also i
> describe BbPostsController do
> context "test" do
> fixtures :bb_posts, :users
> it "should create post" do
> User.find_by_login("amit").should_not be_nil
> post = create_post
> post.should be_valid
> end
> end
> end
>
> (that's an odd spec but let's try to get
David Chelimsky wrote:
> On Thu, Jun 11, 2009 at 11:50 AM, Amit Kulkarni
> wrote:
>> � require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
>> � �if @user
>> �id: 1
>> amit:
>> I dont know what is wrong.
>> Please suggest :-)
&g
Hi,
I am running controller spec and it gives me result as 0 examples, 0
failures.
I checked into the database and i saw that fixtures are not loaded.
Following are the details of my controller file.
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
def valid_bb_
Matt Wynne wrote:
> On 11 Jun 2009, at 08:17, Amit Kulkarni wrote:
>
>>>>
>> those objects.
>> it
>> be fine?
>
> If you're writing the specs after you've written the code, you're
> losing a lot of the value of mock objects.
Actua
David Chelimsky wrote:
> On Wed, Jun 10, 2009 at 5:55 AM, Amit Kulkarni
> wrote:
>> Hello,
>>
>> � � �I had seen many controller spec using mock and stub objects.
>>
>> � � �I had written controller spec earlier without these objects.
>>
>> �
Mohit Sindhwani wrote:
> David Chelimsky wrote:
>> Any Vista users in earshot? I've done all I can do on this.
> Hi David
>
> I'm on Vista, but I just joined the mailing list - could I have a bit of
> a background to what we're trying to do? I'll try to see what I can do.
>
> Cheers,
> Mohi
Hello,
I had seen many controller spec using mock and stub objects.
I had written controller spec earlier without these objects.
In the book it is mention about mock and stub objects.but i am
still not getting the reason behind it.
Can somebody tell me what are these and
David Chelimsky wrote:
> On Tue, Jun 9, 2009 at 1:19 AM, Amit Kulkarni
> wrote:
>>>
>>>> FYI - I get the same result from 1.2.6. All specs pass.
>>
>> Any Updates
>> :-)
>
> Any Vista users in earshot? I've done all I can do o
Amit Kulkarni wrote:
>> You stated above that you were using 1.2.4, but now you are saying you
>> are using 1.2.6. Please be sure to provide accurate information.
>
> I am sorry for the above information.Yes earlier the version was 1.2.4
> but i installed rspec again and it
> You stated above that you were using 1.2.4, but now you are saying you
> are using 1.2.6. Please be sure to provide accurate information.
I am sorry for the above information.Yes earlier the version was 1.2.4
but i installed rspec again and it installed the latest version i.e
1.2.6
> Do you hav
David Chelimsky wrote:
> On Mon, Jun 8, 2009 at 8:31 AM, Amit Kulkarni
> wrote:
>>> I *think* Rails converts the keys in this hash to strings. Try:
>>
>> Channel.should_receive(:new).with('brand_name' => 'manager'
>> ).and_return(
David Chelimsky wrote:
> On Fri, May 22, 2009 at 1:41 AM, Amit Kulkarni
> wrote:
>>
>> � end
>>
>> � it "should create channel" do
>> � �Channel.should_receive(:new).with(:brand_name => "test"
>> ).and_return(@channel)
&g
Hi,
I am trying to execute controller spec by referring to RSpec book
but it is diving me error.
Following are the details:
Ruby version : 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
rspec - 1.2.4
rails - 2.1.2
OS - Vista Home
My channels_controller_spec.rb(which is under
rootproject/spec
David Chelimsky wrote:
> On Wed, May 20, 2009 at 2:47 AM, Amit Kulkarni
> wrote:
>>>> It is not the case that i will always run spec from the root project.So
>> Thank a lot.
>> But is the case that all controller specs are run from the root
>> directory.
>
David Chelimsky wrote:
> On Wed, May 20, 2009 at 1:47 AM, Amit Kulkarni
> wrote:
>>>> script/spec spec/controllers/channels_controller_spec1.rb
>>>
>>> Hey It worked thanks a lot. :-)
>>>
>>> Can you tell me the difference why it was not
David Chelimsky wrote:
> On Tue, May 19, 2009 at 9:04 AM, Amit Kulkarni
> wrote:
>> but i am getting the same error which says RuntimeError in
>> Files/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_control
>> ./channels_controller_spec1.rb:149:
> It looks l
Amit Kulkarni wrote:
> David Chelimsky wrote:
>> On Tue, May 19, 2009 at 9:04 AM, Amit Kulkarni
>> wrote:
>>> but i am getting the same error which says RuntimeError in
>>> Files/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_control
>>> ./cha
Hi,
Thanks for quick response
My channels_controller_spec.rb file is inside controller spec only
i.e. PROJECT_ROOT/spec/controllers/channels_controller_spec.rb.
As per your suggestion i removed the setup method and moved
user_attributes under example groups.
but i am getting the same error whi
Ruby version : 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
rspec - 1.2.4
rails - 2.1.2
OS - Vista Home
I am running a single file by the command
spec channels_controller(filename)_spec.rb
Contents of the file:
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
def setup
@c
Hello,
I am trying to execute controller spec but it gives me error which
says
@controller is nil: make sure you set it in your test's setup
method.
I tried to search for the solution but till now no success :(
Following is the description of the controller spec.
describe ChannelCate
83 matches
Mail list logo