One thing I notice is you have get '/' yet you don't have a root
route. You can define a root route like so:
root :to = pages#home
Also, you can run your requests by doing rake spec:requests
On Aug 27, 4:12 pm, Daniel Lidström dlidst...@gmail.com wrote:
Hello,
I am trying to run my first
Well, you could setup a default parameter hash:
describe MyController do
let(:params) { {:format = 'js'} }
describe '#show' do
it '...' do
get :show, params.merge(:id = 1)
end
end
end
You could also take it another level:
describe MyController do
let(:params) { {:format =
The best practice in your situation is to have two specs like so:
describe #deposit do
it 'adds $10 to a savings account' do
user.bank.deposit(10)
user.bank.deposit.saving.should == 10
end
it 'creates a deposit record' do
user.bank.deposit(10)
user.deposit_record.should ==
This is how I do it:
before { sign_in(user_record) }
describe #index do
before do
controller.current_user.stub(:orders) { ... }
end
it ... do
get :index
end
end
Hope that helps.
On Aug 24, 7:51 pm, Titinux jeremie.horh...@titinux.net wrote:
Hello,
I'm new in using RSpec and
On Aug 27, 8:18 pm, Myron Marston myron.mars...@gmail.com wrote:
One of the primary dangers of using mocks is that your unit tests may
be testing against an interface that is different from that of your
production objects. You may simply have misspelled the method (e.g.
On Aug 27, 8:24 pm, Justin Ko jko...@gmail.com wrote:
On Aug 27, 8:18 pm, Myron Marston myron.mars...@gmail.com wrote:
One of the primary dangers of using mocks is that your unit tests may
be testing against an interface that is different from that of your
production objects. You
On Aug 27, 4:12 pm, Daniel Lidström dlidst...@gmail.com wrote:
Hello,
I am trying to run my first integration tests of my rails 3
application. All tests fail with an error stack level too deep. The
tests are intended to verify the link routes and look like this:
On Aug 27, 8:44 pm, Justin Ko jko...@gmail.com wrote:
On Aug 27, 4:12 pm, Daniel Lidström dlidst...@gmail.com wrote:
Hello,
I am trying to run my first integration tests of my rails 3
application. All tests fail with an error stack level too deep. The
tests are intended to verify
On Aug 27, 8:18 pm, Myron Marston myron.mars...@gmail.com wrote:
One of the primary dangers of using mocks is that your unit tests may
be testing against an interface that is different from that of your
production objects. You may simply have misspelled the method (e.g.
Not necessarily. In the case of a stub on a real object, the purpose is to
control the environment in which the example runs. Consider a method on an
object that returns one value before noon and a different value at noon and
after. In an example for another object that depends on the
On Aug 28, 6:59 am, Daniel Lidström dlidst...@gmail.com wrote:
On 28 Aug, 04:13, Justin Ko jko...@gmail.com wrote:
I would suggest switching to capybara.
Hi Justin,
I tried changing a part of my Gemfile to this:
group :development, :test do
gem 'rspec-rails', '= 2.0.0.beta.19
On Aug 28, 2:44 pm, Daniel Lidström dlidst...@gmail.com wrote:
On 28 Aug, 19:32, David Chelimsky dchelim...@gmail.com wrote:
On Aug 28, 2010, at 11:33 AM, Justin Ko wrote:
Did you remove webrat from the Gemfile?
That won't help with beta.19, which has a hard dependency on webrat
Following the instructions in the README, I still have this problem.
Downgrading to RSpec beta 19 fixes it.
On Aug 30, 11:08 am, David Chelimsky dchelim...@gmail.com wrote:
On Aug 30, 2010, at 9:56 AM, Justin Ko wrote:
On Aug 30, 8:00 am, nathanvda nathan...@gmail.com wrote:
I can't
On Aug 30, 11:59 am, Brennon Bortz bren...@brennonbortz.com wrote:
I am, as usual, assigning an instance variable in a controller's index action
to find all instances of a model in the database. I want to write a spec
that checks that this variable is assigned correctly. I can do:
it
On Aug 30, 12:54 pm, Brennon Bortz bren...@brennonbortz.com wrote:
On 30 Aug 2010, at 17:17, Justin Ko wrote:
On Aug 30, 11:59 am, Brennon Bortz bren...@brennonbortz.com wrote:
I am, as usual, assigning an instance variable in a controller's index
action to find all instances
On Aug 30, 1:09 pm, Rob Biedenharn r...@agileconsultingllc.com
wrote:
On Aug 30, 2010, at 12:54 PM, Brennon Bortz wrote:
On 30 Aug 2010, at 17:17, Justin Ko wrote:
On Aug 30, 11:59 am, Brennon Bortz bren...@brennonbortz.com wrote:
I am, as usual, assigning an instance variable
On Aug 30, 1:32 pm, Justin Ko jko...@gmail.com wrote:
On Aug 30, 1:09 pm, Rob Biedenharn r...@agileconsultingllc.com
wrote:
On Aug 30, 2010, at 12:54 PM, Brennon Bortz wrote:
On 30 Aug 2010, at 17:17, Justin Ko wrote:
On Aug 30, 11:59 am, Brennon Bortz bren...@brennonbortz.com
On Sep 2, 11:24 am, Toni Tuominen tjt...@utu.fi wrote:
On Thu, Sep 2, 2010 at 6:16 PM, nathanvda nathan...@gmail.com wrote:
This will sound awfully stupid, but i have no idea how to start
writing any mailer tests.
I have a mailer class
class SmsMailer ActionMailer::Base
On Sep 13, 3:58 am, nathanvda nathan...@gmail.com wrote:
Whoops. Found it! I have a rcov.rake inside my lib/tasks like this:
desc Run all specs with rcov
RSpec::Core::RakeTask.new(test_cov) do |t|
t.rcov = true
t.rcov_opts = %w{--rails --include views --exclude gems\/,spec
Hello,
It looks like you started your integration spec with context. Try
starting it (top level) with describe. Think of context as setting
the context for what you are describing.
Let us know if that fixes it.
On Sep 9, 1:46 pm, Lee Smith autige...@gmail.com wrote:
I'm missing something in my
On Sep 13, 6:32 pm, nicolas nicolas.br...@gmail.com wrote:
It seems that rspec doesn't support passing a block to a stub method.
This code fails:
def call_build_with_block(o)
o.build do
puts hello
end
end
describe call_build_with_block do
it should call build with block do
On Sep 19, 8:08 pm, Myron Marston myron.mars...@gmail.com wrote:
The current behavior of rspec-mocks causes a NoMethodError when you
call object.foo(x) after setting up a stub using
object.stub(:foo).with(y). Here's an example for when this has caused
me a problem:
- In a before(:each)
On Sep 27, 4:11 pm, Carmen Díaz Echauri cdecha...@gmail.com wrote:
Hi All
Need some brilliants minds here :)
I'm using Rails 2.3.8 ruby 1.8 (I know, I know... )
I've move my gems from .gems to Bundler, but I'm having some issues with
Factory_girl when I rake spec
uninitialized constant
On Sep 27, 6:22 pm, Craig Demyanovich cdemyanov...@gmail.com wrote:
On Mon, Sep 27, 2010 at 5:05 PM, Justin Ko jko...@gmail.com wrote:
On Sep 27, 4:11 pm, Carmen Díaz Echauri cdecha...@gmail.com wrote:
Hi All
Need some brilliants minds here :)
I'm using Rails 2.3.8 ruby 1.8 (I
On Oct 7, 5:36 pm, Tim Gremore timgrem...@gmail.com wrote:
I'm stuck! Not sure what I'm missing but I'm struggling to get a shared
example group working with my controller specs. Here is a piece of the
backtrace:
/Users/20217633/.rvm/gems/ruby-1.9.2...@rails3/gems/rspec-core-2.0.0.rc/lib
-rails.
* Myron Marston for a wealth of thoughtful contributions including Cucumber
features that we can all learn from
* Justin Ko for his direct contributions to rspec, and for relish (
http://relishapp.com/), which makes executable documentation act more like
documentation.
### What's
On Oct 19, 3:56 am, Oscar Del Ben thehcdrea...@gmail.com wrote:
I'm having some troubles understanding how to test a couple of things.
Usually, if I'm having trouble testing something, it means that my design
could probably be improved or changed, but in these cases I think I'm doing
the
I'm under the weather so I won't be able to give you a thorough
answer.
#let - The block is executed when you call it.
#let! - The block is wrapped in a before(:each) filter.
So, you want to use #let!
On Nov 2, 7:55 pm, Nadal node.j...@gmail.com wrote:
Here is my test which passes.
before
Use ruby 1.9.2 - sorry on my iphone
On Nov 3, 4:49 pm, Rhett Sutphin rh...@detailedbalance.net wrote:
Hi,
I've converted a couple of my smaller libraries' spec suites to rspec 2 with
no trouble. (I'm enjoying the new version -- thanks to all involved.) I'm
trying to convert one a larger
On Feb 8, 6:49 pm, Corey Haines coreyhai...@gmail.com wrote:
I have a directory in my spec directory that I want to exclude from rake spec
That is, I have
spec/lib_no_rails
And I don't want it to run when I do rake spec
Best way?
Thanks.
-Corey
--http://www.coreyhaines.com
The
On Feb 14, 11:31 am, Fearless Fool li...@ruby-forum.com wrote:
I have a Premise model with an after_create method, along the lines of:
class Premise ActiveRecord::Base
...
after_create :etl_attributes
...
end
In production code, etl_attributes accesses the web. For testing I'm
Your expectation (should_receive) is expecting start_of_day, which
uses Time.zone. The actual on_day scope does
day.to_time.beginning_of_day, which does not use any time zone.
Therefore, the arguments to in_interval are not the same as the
expectation. And because they are not the same, the mock
and (2) is failing. Output as before:
Failure/Error: Allocation.on_day(start_of_day + 3.hours).should ==
result
NoMethodError:
undefined method `includes_values' for result:String
Any ideas?
Best regards,
Christoph Schiessl
On Feb 15, 2011, at 18:51 , Justin Ko wrote
On Feb 17, 7:36 am, Avdi Grimm gro...@inbox.avdi.org wrote:
On Wed, Feb 16, 2011 at 7:24 AM, Yuriy Naidyon yuro...@gmail.com wrote:
def some_action
raise Exception if some_falsy_value
rescue
@message = 'Error'
end
Don't raise Exception. Raise some descendant of StandardError,
On Feb 16, 7:34 am, Andrew Vargo ajva...@gmail.com wrote:
Hello,
I am running rspec 2 and rails 3 in a project.
When I have a shared example being used in a spec file, I loose the
ability to run a single test in that file.
rspec spec/controllers/proposals_controller_spec.rb:13 for
On Feb 16, 4:31 pm, LesNightingill codehac...@comcast.net wrote:
...trying to debug some interaction between my model specs, a
particular spec passes by itself but fails when I run all my model
specs.
Whenever this happens to me, 90% of the time the cause of the problem
is database state.
On Feb 17, 7:34 pm, Avdi Grimm gro...@inbox.avdi.org wrote:
On Thu, Feb 17, 2011 at 11:46 AM, Justin Ko jko...@gmail.com wrote:
A straight-up exception will bypass all default rescue clauses - I
learn something everyday!
If you will forgive a brief moment of self-promotion, I recently
On Feb 20, 12:54 pm, Rodrigo Alves Vieira rodrig...@gmail.com wrote:
Hello everyone, what are all the configuration options available for the
.rspec file? Currently I only know --colour.
Thanks!
Rodrigo Alves
On Feb 20, 5:07 pm, Samantha John li...@ruby-forum.com wrote:
Additional info:
Rails 3.0.3
Ruby 1.8.7
Gemfile:
gem rspec-rails, = 2.0.0.beta.10, :git =
git://github.com/rspec/rspec-rails.git
gem rspec, = 2.0.0.beta.10, :git =
git://github.com/rspec/rspec.git
gem
On Feb 15, 10:25 am, Karl threadh...@gmail.com wrote:
In MoneyOrdersController controller:
def create
@money_order = current_user.money_orders.build(params[:money_order])
if @money_order.save
flash.now[:msg_ok] = Added money order for:
#{number_to_currency(@money_order.amount)}
On Mon, Feb 21, 2011 at 5:18 AM, Daniel Salmeron Amselem
daniel.amse...@gmail.com wrote:
I'm trying to test this with Ruby 1.9.2, RSpec 2.5.0, and Rails 3.0.4:
context toggle_resource method do
it should remove the resource from the group do
group = Factory(:unique_group)
better the way ARel works.
On Tue, Feb 22, 2011 at 2:25 AM, Justin Ko jko...@gmail.com wrote:
On Mon, Feb 21, 2011 at 5:18 AM, Daniel Salmeron Amselem
daniel.amse...@gmail.com wrote:
I'm trying to test this with Ruby 1.9.2, RSpec 2.5.0, and Rails 3.0.4:
context toggle_resource
On Fri, Feb 25, 2011 at 2:30 PM, Radhesh Kamath li...@ruby-forum.comwrote:
Hi experts,
I picked up a copy of the rspec book and wrote some tests in spec/lib
and spec/models for my Rails 2.3.8 code.
I was using rspec 2.5.1, rspec-core 2.5.0, rspec-expectations 2.5.0 et.
al.
But I realised
On Thu, Mar 10, 2011 at 2:32 AM, Shamaoke shama...@hotmail.com wrote:
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',
On Thu, Mar 17, 2011 at 2:55 PM, Pete Campbell li...@ruby-forum.com wrote:
Even simpler...
describe 'Show' do
it 'should fail because increment is called' do
Counter.should_not_receive(:increment)# Incorrectly passes
get :show, :count_me = 'true'
end
it 'should fail because
On Tue, Mar 22, 2011 at 2:37 PM, Benyi Wang bewang.t...@gmail.com wrote:
When I run rspec in Rails, it seems that a ruby process is created and
loaded with rails components due to the statement require 'spec_helper'.
This usually takes a while to run even a single spec. Does a tool for rspec
On Tue, Mar 22, 2011 at 6:50 PM, Radhesh Kamath li...@ruby-forum.comwrote:
Hi experts,
I am trying to test routing in my application, where all routes are
enclosed in a namespace like so:
scope 'v1' do
resource :blah end
collection do
something
end
end
end
Is there a
On Sat, Mar 19, 2011 at 2:32 PM, Mobyye bhellm...@gmail.com wrote:
I'm trying to post to my controller in RSPEC by doing:
it should store create an IncomingMail record do
lambda {
post :create,
:from = 'xx',
:to = 'xx',
:cc = 'xx',
On Wed, Mar 23, 2011 at 10:16 AM, Radhesh Kamath li...@ruby-forum.comwrote:
Justin Ko wrote in post #988825:
On Tue, Mar 22, 2011 at 6:50 PM, Radhesh Kamath
li...@ruby-forum.comwrote:
end
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
You're
On Thu, Mar 24, 2011 at 10:22 AM, amkirwan amkir...@gmail.com wrote:
I'm try to stub the following in my view code but keep running into
problems with unexpected messages. I've tried stubbing and mocking in
many combinations but can't find away past this. Here is the code
below I am trying to
On Mar 26, 2011, at 12:36 PM, Huw Nichols huw.nich...@gmail.com wrote:
Hi,
Just been looking for answers to this very question:
I have a User model (using devise) and the same problem.
Both the before_create and after_create callbacks fail to run from within
Rspec2
I can even put
On Thu, Mar 31, 2011 at 11:16 AM, Peter Boling peter.bol...@gmail.comwrote:
I have implemented a full solution. Had to persist the list of unused VCR
cassettes to the file system.
Cheers!
It would be still be cool if there was an after hook on rspec, as there is
on capistrano!
On Fri, Apr 1, 2011 at 8:34 AM, Peter Boling peter.bol...@gmail.com wrote:
The before and after :suite hooks work for running code before and after
rspec runs all the tests specified, but I need it to explicitly *not run* when
anything less than every single spec is being run. In other words
On Wed, Apr 6, 2011 at 12:53 AM, Shamaoke shama...@hotmail.com wrote:
Hi.
When I try to inspect example metadata, for some reason it raises the
encoding compatibility exception.
~~~
describe RSpec::Core::Metadata do
describe '#inspect' do
it 'raises Encoding::CompatibilityError' do
On Sun, Apr 17, 2011 at 10:01 AM, David Chelimsky dchelim...@gmail.comwrote:
On Apr 16, 2011, at 4:56 PM, Jarmo Pertman wrote:
Hello!
I've just added a new cool matcher #in into my framework WatirSplash
and thought that this could be integrated into RSpec directly actually
if there's
On Thu, Apr 28, 2011 at 2:06 PM, Sergio Ruiz li...@ruby-forum.com wrote:
i just ran into a problem with some test, and i am not exactly sure why,
but the difference happened when i changed my model validation from:
validate :custom_validation
to:
validate_on_create :custom_validation
On Sat, May 14, 2011 at 12:13 AM, arunsark arun.vydianat...@gmail.comwrote:
Hi
I am using Mongoid. In Mongoid while saving a record we typically give
like in the controller
@post.safely.save
For a model class Post
I am writing rspecs for my controller and want to mock the model. So
what
On Tue, May 17, 2011 at 11:18 PM, Justin Ko jko...@gmail.com wrote:
On Thu, May 12, 2011 at 10:32 AM, Chris Habgood chabg...@gmail.comwrote:
I have this in my admin controller:
before_filter :login_required
before_filter :admin_required
def admin_required
On Thu, May 12, 2011 at 10:32 AM, Chris Habgood chabg...@gmail.com wrote:
I have this in my admin controller:
before_filter :login_required
before_filter :admin_required
def admin_required
current_user.is_admin?
end
___
On Wed, May 18, 2011 at 10:23 AM, Ken Egervari ken.egerv...@gmail.comwrote:
Hello,
Is there any way to reuse spec definitions, perhaps through some kind of
inheritance?
For example, in rails, every time it generates a Spec I must tell it to
1) Include Devise::TestHelpers
you can do:
look at shared state to log the user in and other
things.
Ken
On Wed, May 18, 2011 at 4:06 PM, Justin Ko jko...@gmail.com wrote:
On Wed, May 18, 2011 at 10:23 AM, Ken Egervari ken.egerv...@gmail.comwrote:
Hello,
Is there any way to reuse spec definitions, perhaps through some kind
On Thu, May 19, 2011 at 1:18 PM, S Ahmed sahmed1...@gmail.com wrote:
My user controllers 'create' action looks like:
def create
@user = User.new(params[:user])
@user.user_name = params[:user][:user_name]
@user.email = params[:user][:email]
if @user.is_valid?
@user.status
On Tue, May 24, 2011 at 2:25 PM, Chris Habgood chabg...@gmail.com wrote:
I keep getting returned when looking for a template:
describe edit action do
it edit action should render edit template do
Food.stub(:find_by_id).and_return(food)
response.should
On Tue, May 24, 2011 at 6:10 PM, Chris Habgood chabg...@gmail.com wrote:
It is already there.
On Tue, May 24, 2011 at 19:05, Justin Ko jko...@gmail.com wrote:
On Tue, May 24, 2011 at 2:25 PM, Chris Habgood chabg...@gmail.comwrote:
I keep getting returned when looking for a template
)
response.should render_template(:edit)
end
end
On Tue, May 24, 2011 at 19:38, Chris Habgood chabg...@gmail.com wrote:
no.
On Tue, May 24, 2011 at 19:21, Justin Ko jko...@gmail.com wrote:
On Tue, May 24, 2011 at 6:10 PM, Chris Habgood chabg...@gmail.com wrote
On Tue, May 24, 2011 at 10:34 PM, Paul P. li...@ruby-forum.com wrote:
John,
I know this is quite old, but I wanted to apply your same example in
Rspec 2. I'm getting the following when I attempt to do so.
application_helper.rb
===
module ApplicationHelper
#
On Wed, May 25, 2011 at 11:20 AM, David Chelimsky dchelim...@gmail.comwrote:
On May 25, 2011, at 10:07 AM, Gustavo Delfino wrote:
Hello all. Thanks to subjects, custom matchers and fluent chaining I was
able to greatly simplify my spec. But now I want to DRY my custom matchers.
I have
On Wed, May 25, 2011 at 1:00 PM, Ken Egervari ken.egerv...@gmail.comwrote:
I am using factory_girl, and I have discovered that it is chiefly
responsible for making my tests run slow.
I have posted a question about this on Stack Overflow:
so thrilled. I have not really lost anything in terms of
expressiveness.
Sure, I have to add a pieces of data to make render_views comply, but it's
not much. It is a *very small* price to pay for this much performance gain.
Ken
On Wed, May 25, 2011 at 5:45 PM, Justin Ko jko...@gmail.com
to a
class method?
Regards,
Gustavo Delfino
On May 25, 2011, at 2:04 PM, Justin Ko wrote:
On Wed, May 25, 2011 at 11:20 AM, David Chelimsky dchelim...@gmail.com
wrote:
On May 25, 2011, at 10:07 AM, Gustavo Delfino wrote:
Hello all. Thanks to subjects, custom matchers and fluent chaining
On Fri, Jul 8, 2011 at 2:59 AM, Chandu80 chandu.she...@gmail.com wrote:
Hello All,
I want to know which out of Rspec and Test:Unit is the most used in
the industry for unit/integration testing and why?
http://22ideastreet.com/blog/2011/06/02/the-state-of-ruby-and-testing/
As for whytry
On Wed, Jul 13, 2011 at 11:06 AM, Alexander Glushkov cutal...@gmail.comwrote:
Hey guys,
just wrote a helper for controller specs in the rails. Link to the gist -
https://gist.github.com/1080421 - to view with syntax highlight.
# Helper +action+ allows you to write something like
#
#
On Wed, Jul 20, 2011 at 10:29 AM, Jed Schneider jed.schnei...@gmail.comwrote:
for comparing objects properties, which notation is considered most
idiomatic and best practice?
Thanks,
Jed Schneider
___
rspec-users mailing list
On Mon, Jul 25, 2011 at 8:16 AM, Pablo L. de Miranda
pablolmira...@gmail.com wrote:
Hi guys,
I'm using RSpec with Capybara, and for that I created the
spec/integration folder. But when I execute the command bundle exec
rspec spec RSpec don't execute my files on integration folder. I need
On Mon, Jul 25, 2011 at 9:03 AM, Pablo L. de Miranda
pablolmira...@gmail.com wrote:
Hi Justin,
I'm using RSpec 2.6.0, RSpec-Rails 2.6.1, Capybara 1.0.0 and Rails 3.0.7.
Att,
Pablo
___
rspec-users mailing list
rspec-users@rubyforge.org
On Mon, Jul 25, 2011 at 9:59 AM, Pablo L. de Miranda
pablolmira...@gmail.com wrote:
Justin,
Bellow is my directory tree for spec:
|-- spec
| |-- controllers
| | `-- site_controller_spec.rb
| |-- factories.rb
| |-- fixtures
| | `-- avatar.jpg
| |-- helpers
| | |--
On Fri, Jul 22, 2011 at 1:50 PM, internetchris ch...@utilitygo.net wrote:
Hi Group,
I'm finally taking the time to implement tests in some of my old apps.
I'm using Rails 2.3.5, Rspec 1.3.1, Rspec-rails 1.3.3, and capybara.
Here's an example of my first test, but I'm wondering how I setup
On Mon, Aug 1, 2011 at 8:29 PM, Shane Mingins e...@mingins.com wrote:
Hi All
With the following route
constraints(:host = example.com) do
match (*x) = redirect { |params, request|
URI.parse(request.url).tap { |x| x.host = www.example.com }.to_s
}
end
I am wondering
On Tue, Aug 2, 2011 at 5:52 PM, Piter Fcbk piter.f...@gmail.com wrote:
You are right, I'm talking about rake task.
So the idea is to make an Importer object, do the unit test for that object
and then the task just calls the methods of the objects right?
Thanks a lot for the help, really
}
end
On 2 August 2011 21:37, Justin Ko jko...@gmail.com wrote:
On Mon, Aug 1, 2011 at 8:29 PM, Shane Mingins e...@mingins.com wrote:
Hi All
With the following route
constraints(:host = example.com) do
match (*x) = redirect { |params, request|
URI.parse(request.url
If you are rescuing an exception, test what the rescue does. Purposely cause
the exception, then check the rescue does what it's supposed to.
Sent from my iPhone
On Aug 10, 2011, at 11:13 AM, Lenny Marks le...@aps.org wrote:
As best I can tell, bypass_rescue from rspec-rails-1 is no longer
On Thu, Aug 11, 2011 at 8:40 AM, David Chelimsky dchelim...@gmail.comwrote:
On Aug 11, 2011, at 7:17 AM, Justin Ko wrote:
On Aug 10, 2011, at 11:13 AM, Lenny Marks le...@aps.org wrote:
As best I can tell, bypass_rescue from rspec-rails-1 is no longer part of
rspec-rails, ' 2'. I had been
On Sun, Aug 14, 2011 at 3:48 PM, John Hinnegan john.hinne...@gmail.comwrote:
I was trying to stub something globally, across all tests today, and had
some trouble.
I tried
RSpec.configure do |config|
config.before(:all) do
MyClass.stub(:my_method)
end
end
seems that stub is
On Sun, Aug 21, 2011 at 1:34 PM, Michael Hickman li...@ruby-forum.comwrote:
I am writing a spec to test the behavior of the mashup_controller when
someone sends a query through a URL. I need to simulate the parameters
contained in the URL, and i read that the post() method will do that,
On Sat, Aug 20, 2011 at 7:53 PM, braver delivera...@gmail.com wrote:
I've come across an interesting blog post showing how to inherit
tests:
http://benbiddington.wordpress.com/2010/11/06/rspec-common-base-specs/
How does it stack against the usual mixing/shared_examples_for,
beautifully
On Mon, Aug 22, 2011 at 12:14 AM, ct9a anexi...@gmail.com wrote:
Hi, guys,
After reading the rspec book (dec 2010 edition), I went on to write
controller specs for an application I'm porting over from rails 2.3.x
to rails 3.
1) I ran 'rake routes' and got the following:
parts GET
On Mon, Aug 22, 2011 at 9:09 PM, ct9a anexi...@gmail.com wrote:
Thanks, Justin.
I have the part object mocked up before each spec runs.
--- Extract begins -
let(:part){
mock_model('Part').as_null_object
}
before do
Sent from my iPhone
On Aug 22, 2011, at 10:14 PM, ct9a anexi...@gmail.com wrote:
On Aug 23, 1:55 pm, Justin Ko jko...@gmail.com wrote:
On Mon, Aug 22, 2011 at 9:09 PM, ct9a anexi...@gmail.com wrote:
Thanks, Justin.
I have the part object mocked up before each spec runs
On Tue, Aug 23, 2011 at 6:11 AM, Gordon Yeong anexi...@gmail.com wrote:
Do you have a before filter somewhere that is preventing the
:update_attributes message from being received?
I have checked my application's controllers
(app/controllers/application_controller.rb and
On Tue, Aug 23, 2011 at 6:22 AM, Gordon Yeong anexi...@gmail.com wrote:
I found out why it was not working.
The line, 'Part.should_receive(:update_attributes).with('title' = 'Brake
pads').and_return(part)' should not be there because the controller specs
should not care about implementation
On Wed, Aug 24, 2011 at 6:40 PM, Matthias Siegel
matthiassie...@gmail.comwrote:
Hi,
I'm fairly new to RSpec with Rails and I'm trying to work out how I can
write request specs for resources that require a logged in user.
I can't get this one to pass:
describe GET /admin/account do
it
On Thu, Aug 25, 2011 at 7:38 AM, Matthias Siegel
matthiassie...@gmail.comwrote:
On 25/08/2011, at 11:10 AM, Justin Ko wrote:
On Wed, Aug 24, 2011 at 6:40 PM, Matthias Siegel matthiassie...@gmail.com
wrote:
Hi,
I'm fairly new to RSpec with Rails and I'm trying to work out how I can
On Fri, Aug 26, 2011 at 12:12 AM, Matthias Siegel
matthiassie...@gmail.comwrote:
On 25/08/2011, at 11:45 PM, Justin Ko wrote:
On Thu, Aug 25, 2011 at 7:38 AM, Matthias Siegel matthiassie...@gmail.com
wrote:
On 25/08/2011, at 11:10 AM, Justin Ko wrote:
On Wed, Aug 24, 2011 at 6:40
On Tue, Sep 6, 2011 at 9:40 PM, slavix mikerin.sl...@gmail.com wrote:
Hello,
Is there any way to test model inheritance in spec?
something like..
it { ChildModel.should ParentModel }
thanks.
___
rspec-users mailing list
On Wed, Sep 7, 2011 at 6:08 AM, John Feminella jo...@bitsbuilder.comwrote:
Is there a way to warn but not fail if a particular method wasn't
called? That is, I'm looking for something that's halfway between
obj.stub(...) and obj.should_receive(...). I'm trying to do something
like this:
On Wed, Sep 7, 2011 at 5:50 AM, John Feminella jo...@bitsbuilder.comwrote:
Is there a way to run an `around` block once for every spec *file*
(not spec)? (I want to measure which files take the longest amount of
time, count the number of specs in each file, and then report the
average spec
On Thu, Sep 8, 2011 at 3:03 PM, Justin Beck justinb...@mac.com wrote:
I have a class that expects some input via 'gets'. I found that, when
testing, I can do something as simple as this:
@foo.stub!(:gets) { stuff\n }
However that only works in the most simple case. In my case the class
On Tue, Sep 13, 2011 at 6:56 AM, Matt Wynne m...@mattwynne.net wrote:
Hi all,
In GOOS[1] they use an assertion called assertEventually which samples the
system for a success state until a certain timeout has elapsed. This allows
you to synchronise the tests with asynchronous code.
Do we
On Tue, Sep 13, 2011 at 8:53 PM, slavix mikerin.sl...@gmail.com wrote:
Hi,
Anyone can help me with rspec shoulda validations please.
I can't get the syntax right for these validations. Please correct me
it { should have_one :tradable, :through = :trade_order}
it { should belong_to
On Wed, Sep 14, 2011 at 6:51 AM, Rob Aldred r...@stardotstar.com wrote:
I'm speccing a small lib which manipulates image files using mini_magick.
The lib creates various temporary files during the process, the lib then
cleans up the temporary files at the end.
I'm trying to mock expectations
1 - 100 of 183 matches
Mail list logo