similar to: spec.opts default --load-by and observers

Displaying 20 results from an estimated 10000 matches similar to: "spec.opts default --load-by and observers"

2007 Jan 18
1
spec''ing models with observers that send mail
I''m spec''ing a model with an observer that sends mail. Mailers behave similarly to controllers, so to make the whole thing work, I believe something like integrate_views has to be available. Has anyone dealt with observers and ActionMailer? Thanks
2007 Feb 13
3
spec.opts
Hi, Just built the gem from trunk for the first time and ran into an issue with the generated spec.opts file (rev. 1493). Moving the file out of the way fixed the problem. I''m not on windows, so this is not a win32console gem issue as per the README. /usr/lib/ruby/gems/1.8/gems/rspec-0.8.0/lib/spec/expectations/sugar.rb:13:in `call'': undefined local variable or method
2007 Aug 18
6
RSpec: "--color" not working in spec.opts when combined with "--drb"
Windows XP SP 2 ruby 1.8.5 gems: rails 1.2.3 rake 0.7.3 win32console 1.0.8 plugins: rspec 1.0.8 rspec_rails 1.0.8 spec.opts: --colour --format progress --loadby mtime --reverse --drb When I run "rake spec" or "ruby script/spec spec --color" this is the output: D:\dev\project>rake spec (in D:/dev/project)
2006 Dec 04
1
Model Testings with Observers
I have a Rails model that has an observer. The function of the observer is to send an email when a particular state change occurs in the model. Because the template rendering code is not loaded when doing model testing, I''ve had to shut off the email functionality of the observer for testing. Is there a better way to handle this? Thanks
2007 Mar 19
4
spec.opts: questions about formatters, etc.
Questions concerning spec.opts: 1. Am I correct in believing that each option should go on a separate line of spec.opts in the rails spec directory? If this is so, why is it so? 2. Using a formatter in spec.opts doesn''t seem to work. Here is my spec.opts file: --colour -f s and this is what happens when I run the rake task: Couldn''t find formatter class s Make
2006 Mar 04
2
Declaring ActiveRecord observers
Hello I''m using the ''act_as_authenticated'' plugin to implement a small and simple authentication system in my app. Everything is working just fine and the world is a better place to live in. The plugin creates a ActiveRecord observer in order to send the newly registered user a confirmation e-mail. Per the API docs [1], one should declare the observer in the
2008 Nov 07
6
How to spec a (Trollop-based) binary’s internal state?
I?m trying to spec a ?binary?, and as previously discussed on this list, I?m trying to do it ?from outside? ? i.e., by calling it with Kernel#` and observing the (side-)effects. Unfortunately, this doesn?t really let me spec expectations about its internals. Let?s assume I have a -d flag and I parse it with Trollop to set Conf.debug: opts = Trollop::options do opt :debug, ''Print debug
2007 Feb 05
1
long jumping out of code in specs
I wrote this abomination just now, and wonder if anyone else has had experience with the pattern behind it. In short, I''m specing an after_create hook on an ActiveRecord model, that calls a bunch of private methods. Instead of stubbing all those private methods (which is verboten anyway, as well as impossible because creating the object which owns those methods is what I''m
2006 Aug 16
1
Active Record Observers causing 404''s and other weird issues
Hi all. I''ve got a simple AR Observer: class NewOrderObserver < ActiveRecord::Observer observe NewOrder def after_create(object) Note.create(...) end end In environment.rb I have the following line: config.active_record.observers = :new_order_observer And in application.rb I have: NewOrderObserver.instance Aside from simply not working, it''s causing
2008 Feb 05
0
adding observers outside environment.rb
I need to add an ActiveRecord observer and thought I should follow Rails 2 intent by not changing the base environment.rb I create a file config/initializers/observers.rb but don''t know what to add to it. I can''t add: config.active_record.observers = :user_observer Since "config" isn''t defined in the scope of the initializer file and I don''t know if
2006 May 03
0
Testing Observers
Greetings all, As a Noob, I''ve been diligently working my way through the AWD4R book and finally arrived at the part about observers -- which BTW I think are very cool tech. Anyhow, I got the Audit Observer working. Now I want to test it and perhaps examine it''s attributes and methods to make sure it does what is expected of it. For example, one thing I would like to do
2007 Feb 22
9
specking, speccing, or spec''ing
I vote for spec''ing. Anybody else?
2007 Jul 30
4
Stubbing Observers in rails?
In most of my tests I''d like to be able to stub out the observers for my models, but I''m not sure the best way to do this. I doesn''t look like there is a way to stub all instance methods, and I don''t seem to be able to stub early enough to stub out the observer as it''s instantiated. I can think of several hackish ways to get around it, but I was
2007 Jan 22
1
Observed models cause failures with DRBSpec ?
Hi all ! I don''t believe I am the only one using model observers, right ? Well, here''s a nice one: $ drbspec spec . Finished in 0.125322 seconds 1 specification, 0 failures $ drbspec spec F 1) ''A user with an inactive and an active project should be able to return active projects only'' FAILED [] should == [#<Spec::Mocks::Mock:0xb75590bc
2006 Feb 22
2
Removing form observers
Hi, I''m developing a Rails app which uses dynamic forms. To implement these, I''ve used AJAX and Rails''s built-in form observers. Unfortunately, I''m having a problem. This is how the form starts: * Country select box [OBSERVED] (Republic of Ireland selected) * County select box [OBSERVED] (none selected, list of Republic of Irish counties in the drop down)
2010 Apr 16
1
Active Record observers broken: can't be used for "before" callbacks
I was just wondering what about a report that I made almost 2 months ago: Active Record observers broken<https://rails.lighthouseapp.com/projects/8994/tickets/4087-activerecord-observers-cant-be-used-for-before-callbacks> I think it''s a pretty big bug. In Rails 3, creating an observer with a "before_save" callback (for instance) will result in all observed models being
2007 Apr 13
1
HTML report and Spec::Ui improvements
The trunk now has some nifty improvements to the HTML report (--format html). Each failing spec will (in addition to the backtrace) have a box with a source code snippet of the offending code. If you have Jamis Buck''s syntax gem installed the code will also be syntax highlighted 8-D There has also been some major improvements to Spec::Ui, and it should be much easier to set up than
2006 Mar 10
9
Observers?
Hello all! I''m having an issue with Observers, and I''m hoping someone knows the answer. Here is the definition: app/models/vehicle_observer.rb > class VehicleObserver < ActiveRecord::Observer > def after_save(vehicle) > breakpoint > if vehicle.has_new_mil_indication? > UserMailer.deliver_mil_notice(vehicle) > end > end > end
2012 Dec 06
2
Bye Bye, Observers
Observers will be no more as of Rails 4, farewell, never been much of a fan. However, I''m using it in one of my gems which enables model attributes for use with a WYSIWYM editor. The resulting markup is persisted, but in order to use it in a view, it has to be nokogiried in a helper which fragment caches the result. This cache has to be zapped once the model instance is either
2006 Jul 21
2
ActiveRecorod observers don''t work in mongrel?
Am i wrong or do ActiveRecord observers not work in mongrel? Is there a work around for this? I am 100% sure of this because in my observer i put raise "whatever". Whenever I try update the model using the mongrel server I get a successful save. If I do it in webrick I get an exception raised. Any ideas what I should do? Because webrick is pretty annoying to work with. Thank