Break your object up. It's too big.
On Wed, Oct 14, 2009 at 12:36 PM, Joaquin Rivera Padron
wrote:
> hello there,
> how do you tipically spec private methods? The thing is Ï have something
> like this:
>
> def some_method
> complex_method + other_complex_methods
> end
>
> private
> def comple
wait why do you want to do this?? Just use a regular hash and do
state-based assertions on it. Or determine the role that this
hash-like thing is doing, and use a mock to define a proper interface.
Ashley's solution works but I am very skeptical that the approach is
a good one. Can you post som
user = mock('user')
controller.stub(:current_user).and_return user
friendships_proxy = mock('friendships proxy')
user.stub(:friendships).and_return friendships_proxy
friendship = mock('friendship')
friendhips_proxy.stub(:build).and_return friendship
Try to avoid chains like this. Makes the test s
Is this all of the code, or did you remove some stuff? I copied the
code in a new rails app and the test passed. What versions of rspec &
rspec-rails are you running?
Pat
On Tue, Oct 20, 2009 at 5:23 AM, Alexander Seidl wrote:
> http://pastie.org/pastes/661816
>
> hi,
> please have a look at m
Response written as I go through the slides, and late at night under
sleep deprivation ;)
* 57 juicy slides in half an hour? Damn dude.
* Not a fan of the "defining an interface" service example. A single
method named #query that accepts a string that appears to have the
real command is not much
or check out fixjour (http://github.com/nakajima/fixjour/) which is
better imo because it has a better API and fewer surprises
(associations in factory girl always confuse me)
Pat
On Mon, Oct 5, 2009 at 3:32 AM, Mithun Perera wrote:
> Hi
> please any body can help me to learn the basics of Facto
On Mon, Oct 12, 2009 at 6:26 PM, Scott Taylor wrote:
>
> On Oct 12, 2009, at 9:14 PM, David Chelimsky wrote:
>
>> On Oct 12, 2009, at 9:37 PM, Sam Woodard wrote:
>>
>>> I have an interesting setup: I am using rspec for mocking but I have
>>> mocha installed which give me access to any_instance, e
On Wed, Oct 21, 2009 at 6:56 AM, Alexander Seidl wrote:
> I started a new test: Have a look at my new code:
> http://pastie.org/663455
>
> 1) The categories_controller is NOT called from the test!
>
> 2) I created another example with a message_controller and associated
> tests. There, the control
On Wed, Oct 21, 2009 at 3:58 AM, Alexander Seidl wrote:
> hi pat,
> thats all of the code that will be executed in
> categories_controller_spec.rb. the rest is commented out.
Looks like this may be the same issue as the other thread. You didn't
show all the code, because there's an unknown UserC
Already in.
[1,2].should =~ [2,1]
Pat
On Wed, Oct 28, 2009 at 4:44 PM, Rodrigo Rosenfeld Rosas
wrote:
> How about having this matcher along the default available matchers?
>
> require 'set'
> Spec::Matchers.define :have_same_elements_of do |expected|
> match do |actual|
> expected.to_set ==
Pair with them. How big's the team? Lots of ways you can do this.
If there are 5 other devs, you can pair with one each day, bam,
training in a week. If there are 10, you pair with 5 for one week,
then have those guys pair with the other guys over the next week
(rotating every day). Does anybod
[...@admin, @allowed_user].should all(be_allowed_to_visit(url))
[...@admin, @allowed_user].should all_be_allowed_to_visit(url)
I prefer the first so as not to introduce more "magic" but if it catches on
then moving to the second might be worthwhile.
Pat
On Dec 9, 2009, at 5:27 AM, David Chelims
http://archive.patmaddox.com/blog/2009/1/15/how-i-test-controllers-2009-remix
is my take on things. Due for an update though looks like :)
On Dec 16, 2009, at 8:56 AM, Stefan Kanev wrote:
> Hey guys.
>
> I switched completely to RSpec and Cucumber this spring and I am really happy
> with. Wh
On Dec 22, 2009, at 2:08 PM, David Chelimsky wrote:
> On Tue, Dec 22, 2009 at 9:33 AM, rogerdpack wrote:
> > raise_error already catches any type of exception, error or not:
> >
> > class BlahException < Exception; end
> > class BlahError < StandardError; end
> >
> > lambda { raise BlahExce
I use resource_controller, and then don't need to write controller specs
because it's all boiler-plate. If I add any custom behavior that needs more
focused testing than cucumber provides, I can just write a couple specs to
cover it.
Pat
On Jan 4, 2010, at 11:16 AM, Nicolás Sanguinetti wrot
The spec has Admin::BaseController as the described type. So of course it's
going to test against that. If you want to test a different class, you need to
describe that instead!
On Jan 5, 2010, at 9:36 AM, Phillip Koebbe wrote:
> I'm trying to implement a base controller that other controller
On Jan 15, 2010, at 6:19 AM, Ashley Moran wrote:
>
> On 14 Jan 2010, at 17:02, Rick DeNatale wrote:
>
>> -1
>>
>> You can already say
>>
>> a.should include("1:4")
>>
>> which is clearer IMHO.
>
>
> I assume Roger was referring to the general case though (which I still don't
> like) - and
class User < ActiveRecord::Base
named_scope :admins, :conditions => {:admin => true}
end
describe User, "admins" do
it "should include users with admin flag" do
admin = User.create! :admin => true
User.admin.should include(admin)
end
it "should not include users without admin flag
On Jan 18, 2010, at 7:12 AM, David Chelimsky wrote:
> On Mon, Jan 18, 2010 at 9:03 AM, Ashley Moran
> wrote:
>>
>> On Jan 18, 2010, at 9:31 am, Pat Maddox wrote:
>>
>>> define_simple_predicate_matcher :rise_from_the_ashes?
exactamundo
On Jan 20, 2010, at 7:27 AM, Corey Haines wrote:
> Is something like this what you were thinking of?
>
> http://gist.github.com/281907
>
>
>>>> On Jan 18, 2010, at 9:31 am, Pat Maddox wrote:
>>>>
>>>>> define_simple_pr
Please provide more context. There should be a stack trace that tells you at
which line the error occurs.
This problem typically occurs when you have a method that calls itself and has
no return mechanism. Sometimes that can be a sloppily implemented
method_missing.
I can't see anything obvi
Look in spec/spec_helper.rb for the configuration block, and hook up your
custom stuff there:
Spec::Runner.configured do |config|
config.before(:each) { AfterFixturesLoaded.custom_stuff1 }
config.after(:each) { AfterFixturesLoaded.custom_stuff1 }
end
Pat
On Feb 16, 2010, at 8:48 AM, Ben F
I disagree with the crowd on the basis that these examples are lazy. Very
close to what I do though.
Imagine you had one other example in there:
it "should assign the post to the view" do
post :create
assigns[:post].should == @post
end
Then you wouldn't really need the other should_receive
Extract redirect logic to an object or helper and test that.
UrlRewriter.new.rewrite('/foods/search/almonds').should == '/almonds'
helper.rewrite_url('/foods/search/almonds').should == '/almonds'
and then you will see that this should probably be called higher up in the call
stack, in a before_f
>From a mocking / stubbing perspective, how is this different from
Article.all(:conditions => ['published_at <= ?', Time.now], :include =>
:comments)
?
i.e. in both cases wouldn't you do
class Article
def self.active_published
all :conditions => ['published_at <= ?', Time.now], :include =>
I just use a factory method.
describe 'Authorize.net CIM gateway', :shared => true do
describe 'saving a card' do
describe 'preconditions' do
it "should raise an error if the card is not saved" do
lambda {
gateway.save_credit_card(Factory.build(:credit_card, :user =>
I'm going to argue that your design is off, and then ignore the rest of your
post :)
class Person < Struct.new(:name, :age)
VOTING_AGE = 18
def voter?
age >= VOTING_AGE
end
end
Now your tests become very simple:
Person.new('Jenny', 17).should_not be_voter
Person.new('Bob', 18).should
.
>
> On Feb 23, 1:43 pm, Pat Maddox wrote:
>> I'm going to argue that your design is off, and then ignore the rest of your
>> post :)
>
> Fair enough :) The 'design' in my example was made up on the spot to
> try and illustrate the kind of issues I
On Mar 3, 2010, at 5:26 AM, David Chelimsky wrote:
> On Wed, Mar 3, 2010 at 2:16 AM, vtr wrote:
>> Hi All,
>>
>> This is Thiyagarajan Veluchamy from India, i am new to rspec. gI need
>> to learn rspec. Can anyone guide me, how to start properly.
>> Advance Thanks,
>
> Hi Thiyagarajan. Welcome t
describe "something something", :shared => true do
...
end
describe "chunky bacon" do
it_should_behave_like "something something"
end
On Mar 6, 2010, at 2:31 PM, Nick Hoffman wrote:
> API Dock says that "share_examples_for" is deprecated. If that's
> correct, what should we be using instea
I've never heard of CurbFu, but according to
http://github.com/gdi/curb-fu/blob/master/lib/curb-fu.rb#L43 it defines a stub
method already. So you're hitting that one, which expects two arguments.
stub! goes to RSpec's mocking framework.
Pat
On Mar 19, 2010, at 10:00 AM, Nick Hoffman wrote
Not I, but let me know if you come across anything please. Sounds interesting.
On Mar 24, 2010, at 12:36 PM, Peter Fitzgibbons wrote:
> HI Folks,
>
> Roll Call for anyone using Rspec for Ruby Game Development (Rubygame, GOSU,
> TkRuby, etc.) ???
>
> I'm having trouble finding the latest-and-
On Mar 30, 2010, at 7:23 AM, George wrote:
> When you need to check several properties of an object, what is the
> best way to match them all?
>
> I'm using the 'satisfy' matcher at the moment but perhaps there's a
> better way than this:
> flight.should satisfy { |f|
>f.booking_code
Sounds like a lot of work
On Apr 3, 2010, at 9:08 PM, Julian Leviston wrote:
> Sorry I meant send AND __send__
>
> Julian.
>
> On 04/04/2010, at 11:45 AM, Julian Leviston wrote:
>
>>
>> On 04/04/2010, at 7:32 AM, David Chelimsky wrote:
>>
>>> On Sat, Apr 3, 2010 at 8:56 AM, Vojto Rinik wro
On Apr 14, 2010, at 12:28 PM, rogerdpack wrote:
> I remember reading a post where somebody mentioned something like
>
> "sometimes after a refactoring, a test block like
>
> lambda { ... }.should raise_error
>
> catches a NoMethodError in error, thus is actually failing, but the
> user isn'
Put the interesting bits in a basic Ruby class and test that, then make the
Rake tasks a very thin layer over the class.
On Apr 19, 2010, at 8:46 AM, Rick DeNatale wrote:
> I released a new gem this past weekend which adds a new rake task for
> Jeweler to generate a release announcement.
>
> I
Cucumber features are the best tool I know of for capturing requirements from
my customer. RSpec specs are the best tool I know of for communicating intent
and gauging code quality among the developer team.
I'm not sure how exactly you're quantifying a 90/10 or 80/20 split. I would
expect tha
On Apr 22, 2010, at 9:57 AM, Zach Moazeni wrote:
> I'll jump in here as I was one of the guys who presented a shift in my
> testing strategies at the Great Lakes Ruby Bash.
>
> To give some context, I've built projects that were very focused on isolation
> tests that used Rspec and Mocks to ass
Rails apps (where SRP violations are pretty much built-in).
They just make your test suite a bit slower, limit reuse, etc... things that
are valuable to us but typically not as valuable as just shipping.
Pat
> On Wed, Apr 21, 2010 at 7:05 PM, Pat Maddox
> wrote:
>> Cucumber featur
Could you share a bit more about what you are actually trying to achieve?
On Apr 28, 2010, at 1:51 PM, Ryan S wrote:
> describe "Test" do
> after(:each) do
> if ERRORS #execute custom code here
> end
>
> it "should explode" do
>#Test.explode --> "fizzle"
>Test.explode.should ==
On May 14, 2010, at 8:09 AM, Daniel Salmeron Amselem wrote:
> Hi,
>
> I have a problem when testing the deletion of a record from the
> database. I am using RSpec methods to check if my account object is
> being destroyed.
>
> The factory creates an account object and saves it into the DB. Also
What does "gem list rspec" show? And "echo $PATH" ?
On Aug 10, 2010, at 9:17 AM, Brad Pauly wrote:
> I've just uninstalled all versions of rspec and installed
> rspec-2.0.0.beta.19 and rspec-rails-2.0.0.beta.19 for a rails project
> and I can't find the rspec command. Based on what bundler is t
Lille wrote:
Hi,
I seek to authenticate and then test other routing in RSpec, but the
standard RSpec vernacular...
describe SomeController do
it "blah-blah" do
get :new
...
end
end
...doesn't seem to allow me to post my login data, as in the following
pseudo-code:
describe
search this page for "shared example groups" http://rspec.info/documentation/
On Sep 20, 2010, at 12:07 PM, Gene Angelo wrote:
> I assume spec tests be repeated for derived classes?
>
> Is there such a thing in rspec as deriving specs?
> --
> Posted via http://www.ruby-forum.com/.
> __
On Oct 19, 2010, at 12:56 AM, Oscar Del Ben 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 right thing
On Dec 7, 2010, at 8:40 PM, Shea Levy wrote:
> Hi all,
>
> I'm new to RSpec and to TDD/Agile methods in general (by "new" I mean I'm
> about 4/5 of the way through The RSpec Book and haven't yet actually
> implemented the practices in my projects), so this question may seem silly.
> Suppose I'
On Dec 6, 2010, at 4:29 AM, Dean wrote:
> I'm completely new to RSpec (and fairly new to Rails, too.) I'm
> working on an existing application that has an Admin::BaseController
> and sub-controllers such as Admin:TestimonialsController:
>
> class Admin::BaseController < ApplicationController
>
Why don't functional specs count towards your coverage metric? It sounds like
you're shooting for 100% unit test coverage -- why? If you write code in order
to make your functional specs pass, then that code was TDD'd...right?
Pat
On Dec 10, 2010, at 2:29 PM, Andrew Wagner wrote:
> I went ba
Sounds like a validation failure. My guess is that you're re-using the
factory-created record's attributes, and your example fails because of a
uniqueness validation. This would explain the rollback if you're using the
create! or save! method.
Pat
On Dec 13, 2010, at 3:08 PM, djangst wrote:
Try assigns(:correspondence) instead. If that doesn't work, I would inspect the
value of @job.correspondences.build (when run in the test). It's possible that
stub_model is causing #build to return nil -- I don't remember the behavior off
the top of my head and don't have a Ruby available to che
mock.should_receive(:write).with("\n").ordered
Append .ordered as above
On Dec 17, 2010, at 6:12 AM, "niku -E:)" wrote:
> Hello.
> My name is niku.
>
> I'm using rspec 2.2.1
>
> /tmp% rspec --version
> 2.2.1
>
> I tested http://gist.github.com/744935 and passed.
>
> /tmp% rspec stdout
On Jan 18, 2011, at 2:30 PM, Wilker wrote:
> Yeah, unfortunately I'm not receiving too much feedback about it for now, so,
> I'm just using for myself and trying to make it better. I will try to spread
> more and more the idea, so make more people wanna try it, its a different
> concept and I m
Yeah 'spec/*' is RSpec 1.x and 'rspec/*' is RSpec 2.x. The stuff you're seeing
on the web is referring to RSpec 1.x.
On Jan 18, 2011, at 9:44 PM, Katrina Owen wrote:
> That sounds suspiciously like something on your system thinks it is
> RSpec 1.x whereas something else thinks it's RSpec 2.x.
I load my XML docs into a hash using Hash#from_xml and then compare the hashes.
On Jan 26, 2011, at 7:26 AM, Matt Wynne wrote:
> I have a problem. I have a test that needs to assert that one XML document
> looks exactly like another XML document.
>
> I couldn't find a way to compare them as
On Jan 27, 2011, at 6:53 PM, Rick DeNatale wrote:
> On Thu, Jan 27, 2011 at 6:16 PM, David Chelimsky wrote:
>> On Jan 27, 2011, at 5:11 PM, John Feminella wrote:
>>
>>> That's not quite right. :each runs before _each_ spec, while :all runs
>>> once, before _any_ spec.
>>
>> Perhaps :any is a b
cattr_accessor, class vars / class instance vars, constants, globals...all
things that maintain state across test runs, and so could lead to errors like
this. I'd start looking there.
Pat
On Feb 24, 2011, at 9:55 AM, Fearless Fool wrote:
> I'm baffled. If I do:
>
> $ bundle exec ruby -S r
On Feb 24, 2011, at 6:09 PM, Wilson Bilkovich wrote:
> On Thu, Feb 24, 2011 at 8:39 AM, Ross Kaffenberger wrote:
>> Anyone have rspec-2 working with rails 2.3.x? We're looking at this route as
>> an incremental step towards upgrading to rails 3.
>> I saw David C mention in the rpec-2 release note
On Mar 20, 2011, at 9:38 PM, andyl wrote:
> OK - I got this working using mocha and the 'any_instance' method.
>
> A gist with working examples is here: https://gist.github.com/879029
>
> It looks like rspec mocks had an 'any_instance' method, but it was removed
> because it promoted 'bad pra
On Mar 22, 2011, at 6:50 PM, Radhesh Kamath wrote:
> 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 clean way
On Mar 19, 2011, at 2:32 PM, Mobyye 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',
>:subjec
What do you mean that it's "leaking" into the other test? If you have
transactions turned on, then any records inserted into the db will be removed
for the next test.
My guess is that other tests just don't set up the required data...which is a
problem with ActiveRecord callbacks and observers.
Use mocks to define your interface, not to define TCPSocket directly. I would
suggest running a TCP server just to test your wrapping object.
Pat
On Mar 30, 2011, at 9:34 AM, Curtis j Schofield wrote:
> I am designing a test around a class that interacts with TCPSocket - I
> have used a mock a
On Apr 2, 2011, at 6:20 AM, Kai Schlamp wrote:
> I use RSpec mock and stub like this:
>
> hit = mock("hit", :stored => 5)
>
> This works fine, but when using this instead:
>
> hit = mock("hit").stub(:stored) { 5 }
Not that it's really necessary, but to make this work you can do:
hit = mock('h
On Apr 3, 2011, at 8:24 AM, andyl wrote:
> I am using rspec/aruba to do integration tests of a command-line program i'm
> writing.
>
> I'd like to use something like FakeWeb to stub the network calls in the
> command-line program.
>
> But with aruba, the program under test runs in a separate p
On Apr 28, 2011, at 4:37 PM, David Kahn wrote:
> I am a bit new to mocking. I am trying to stub the
> ActiveMerchant::Billing::PaypalGateway#authorize method but not clear how to
> do it. This is my code and spec.
>
> This is the pertinent code:
>
> module Payment
> def gateway
> Active
On Jun 12, 2011, at 10:52 AM, Patrick J. Collins wrote:
>> What do you mean by "on target"? Are you asking if the implementations are
>> the same, or similar? Or are you asking if attest meets the same goals as
>> RSpec?
>
> More specifically, I meant the way he implements describe blocks and the
On Aug 2, 2011, at 4:41 PM, Piter Fcbk wrote:
> I have a task that runs frequently in order to get/import data from another
> system.
> Because of this I wanted to know which is the best way to test tasks in order
> to create the tests needed.
>
> Thanks in advance.
I write simple objects that
I use spec/support or Rails.root/bdd_support
not a big deal really. just pick a place and require em
On Sep 21, 2011, at 7:35 PM, Patrick J. Collins wrote:
> Hi,
>
> I have some helper methods such as:
>
> def mock_omniauth
> OmniAuth.config.test_mode = true
> OmniAuth.config.mock_auth[:face
https://www.relishapp.com/rspec/rspec-core/docs/example-groups/shared-examples
On Sep 26, 2011, at 2:11 PM, Patrick J. Collins wrote:
> I've got many models that have this declared:
> has_many :notifications, :as => :notifiable, :dependent => :destroy
>
>
> ... And so I have many model spec
On Oct 11, 2011, at 5:22 PM, Patrick J. Collins wrote:
> Having a spec that does:
>
> @my_model.alert_flag?.should be_true
>
> Seemed a little goofy to me... So I did:
You can do
@my_model.should be_alert_flag
A custom matcher isn't worth it in this case, in my opinion.
Pat
___
On Oct 11, 2011, at 6:19 PM, David Chelimsky wrote:
> On Oct 11, 2011, at 7:38 PM, Pat Maddox wrote:
>
>> On Oct 11, 2011, at 5:22 PM, Patrick J. Collins wrote:
>>> Having a spec that does:
>>>
>>> @my_model.alert_flag?.should be_true
>>&g
Yes it's by design, no you cannot circumvent it. What you can do is use mocks
to avoid expensive DB hits, or have multiple expectations in a single example.
Pat
p.s. This is Ruby, so you absolutely *can* circumvent it. How to do that and
whether it's worth the trouble is up to you to figure out
On Oct 12, 2011, at 4:59 PM, Patrick J. Collins wrote:
> ... But I just tried doing this in RSpec with before :each, and it seems that
> my @foo ivar is non existant inside the inner context.. Is this the way
> it's supposed to be?
post the whole example
_
On Nov 3, 2011, at 4:07 PM, Patrick J. Collins wrote:
>> So, I am writing tests for a presenter class that outputs html markup.
>>
> Actually now that I am thinking about it.. Would you guys recommend that I
> use
> something like Nokogiri to parse the content and test for things like number
>
On Nov 14, 2011, at 4:57 PM, Patrick J. Collins wrote:
>
> Can anyone suggest a better way?
Really tough to follow that example, so apologies if I'm off.
I use the template method pattern for stuff like this. My shared example group
references a method that isn't implemented. Example groups tha
On Dec 7, 2011, at 1:57 AM, Nikolay Sturm wrote:
> * David Chelimsky [2011-12-07]:
>>> reading "Growing Object-Oriented Software, guided by tests", I came
>>> across the distinction of class, role and responsibility.
>>>
>>> While classes are classes and responsibilities could be mapped to public
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 co
On Dec 13, 2011, at 9:32 PM, Bill Christian wrote:
> I have a project that collects various application configurations across a
> couple thousand servers and wants to validate settings are following
> recommended values. For example, all weblogic servers should have a minimum
> memory heap siz
On Dec 22, 2011, at 12:33 PM, LeeQ wrote:
> Ah, I see what you are saying. But no, I still want the exception to act
> like an exception. My problem is that I'll have a test fail for reasons
> unknown, and I then I need to open the test logs to find the exception. I'd
> like those exception
On Friday, June 22, 2012 3:34:51 AM UTC-6, Joshua Muheim wrote:
>
> Hey everybody
>
> I came here through the RSpec Book, so I grant myself to ask something
> about Cucumber here. ;)
>
> I'm still very new to the topic and read a lot of different opinions
> about how to do great Cucumber scenar
Curtis, hey man, I saw your post in the rspec list archives
(http://rubyforge.org/pipermail/rspec-users/2013-August/021811.html). I use
context with pattern A:
describe UsersController do
describe "POST create" do
it "creates a user" do
...
end
context "with bad data" do
Tim Harper <[EMAIL PROTECTED]> writes:
> I was getting a little tired of adding 2 plugins every time I create a
> new rails project, so I just built an rspec-rails gemspec, and it
> works perfectly well. Does anybody know why there isn't a public
> rspec-rails gem?
I don't know if I should be as
Michael Latta <[EMAIL PROTECTED]> writes:
> David,
>
> It seems to me that the root of the problem is that the specification
> is incorrect. Since Rails returns association proxies the
> specification fails because it does not specify what the behavior
> should be. I would suggest that instead o
Scott Taylor <[EMAIL PROTECTED]> writes:
> On Sep 30, 2008, at 11:06 AM, David Chelimsky wrote:
>
>> On Tue, Sep 30, 2008 at 9:55 AM, Luke Melia <[EMAIL PROTECTED]>
>> wrote:
>>> On Sep 15, 2008, at 4:35 PM, Pat Maddox wrote:
>>>
>>>&g
Neil Cauldwell <[EMAIL PROTECTED]> writes:
> Does anyone know how I can write a spec along the lines of this (but a
> working implementation);
>
>it "should not include inactive users" do
> do_get
> assigns[:results].should_not include(users(:inactive_user))
>end
>
> I'm a newbie
Ashley Moran <[EMAIL PROTECTED]> writes:
> *does* pass the specs, both the one that says parse should be called,
> and the one that say it shouldn't! But why? I'm prepared to admit
> I'm just missing something really really really obvious (it happens
> often), but how can:
>
> it "should atte
Neil Cauldwell <[EMAIL PROTECTED]> writes:
> Is my stubbing breaking this? I hope not because Thinking SPhinx isn't
> determining the scope of the search in relation to the 'active' state of
> the users; the search is built on top of a named scope on the User
> model;
>
> # GET /searches/peopl
Ashley Moran <[EMAIL PROTECTED]> writes:
> On 1 Oct 2008, at 15:23, Pat Maddox wrote:
>
>> I think this may be a bug that I introduced recently. Fortunately I
>> also think someone already wrote a patch :) Check out
>> http://rspec.lighthouseapp.com/projects/
Neil Cauldwell <[EMAIL PROTECTED]> writes:
> Pat Maddox wrote:
>> Neil Cauldwell <[EMAIL PROTECTED]> writes:
>>>
>>> respond_to do |format|
>>> format.html
>>> format.xml { render :xml => @results }
>>> end
Neil Cauldwell <[EMAIL PROTECTED]> writes:
> Pat Maddox wrote:
>> Neil Cauldwell <[EMAIL PROTECTED]> writes:
>>
>>>>
>>> (which it doesn't, therefore suggesting the spec is broken);
>>>def do_get
>>> ThinkingSphinx
Neil Cauldwell <[EMAIL PROTECTED]> writes:
> Pat Maddox wrote:
>> Neil Cauldwell <[EMAIL PROTECTED]> writes:
>>
>>>>> ...so shouldn't the spec fail if we're returning all the users fixtures
>>>> which is true. [1,2,3]
Ashley Moran <[EMAIL PROTECTED]> writes:
> On Oct 01, 2008, at 6:39 pm, David Chelimsky wrote:
>
>> There were a couple of other bugs introduced in 1.1.5 so I would like
>> to get out a 1.1.6 very soon. Probably over the weekend if we can get
>> them all fixed.
>
>
> Cool thanks David.
>
> It's no
Evan Dorn <[EMAIL PROTECTED]> writes:
> I want to make sure all external resources called for by my views (like
> images) actually exist. How do I write an rspec that will fail when an
> image included on the page isn't present?
>
>
> For example, let's say in application.html.erb, I include src
"Zach Dennis" <[EMAIL PROTECTED]> writes:
> On Fri, Oct 3, 2008 at 4:46 PM, Donald French <[EMAIL PROTECTED]> wrote:
>> Can someone tell me the difference ins the gem versions and the plugin
>> versions? do they work together? need both?
>>
>
> You do not need both. The plugin versions are for Rub
Hey everyone,
We're doing a panel on testing at the Voices That Matter conference
(http://www.voicesthatmatter.com/ruby2008/ - you should go :). Obie set
up a google moderator thing [1] to collect questions for the panel. I
invite you all to put some questions up on there. They can be questions
Scott Taylor <[EMAIL PROTECTED]> writes:
> On Oct 5, 2008, at 11:11 AM, Pat Maddox wrote:
>
>> Hey everyone,
>>
>> We're doing a panel on testing at the Voices That Matter conference
>> (http://www.voicesthatmatter.com/ruby2008/ - you should go :). Obie
Rémi Gagnon <[EMAIL PROTECTED]> writes:
> Hello,
>
> I mocked a model and I need to test when I set for instance '000' to an
> attribute 'A' that B attibute is set to ''. I don't want to stub or
> mock the B(accessors) to that value cause I want to make sure my
> controller will do that.
>
>
What are you currently seeing? afaik, you should currently see all the
dots and a few F's when specs fail, and then after that you'll see
detailed failure messages including backtraces.
Pat
"Greg Hauptmann" <[EMAIL PROTECTED]> writes:
> Hi,
>
> Can I get more details in the "rake spec" output
In a 1.2.6 app (don't ask), I don't see the generators available to me
with the gems installed. However the documentation makes it look like
it should work:
Generator gems are also available:
1. gem search -r generator
2. gem install login_generator
3. ./script/generate login
I've confirmed
> I've confirmed that with a fresh rails (2.x) app it works fine. Is
> this supposed to work with 1.2.6? Are there any workarounds that
> people have? Is my app just fucked atm?
erm, I've also confirmed that with a fresh rails 1.2.6 app it DOESN'T
see the gem generators. I'm pretty suspicious
1 - 100 of 645 matches
Mail list logo