similar to: spec''ing calls to super (or other Ruby keywords)

Displaying 20 results from an estimated 5000 matches similar to: "spec''ing calls to super (or other Ruby keywords)"

2008 Apr 25
6
ActionMailer
Hi all, I need a help. I have got a user registration form, where the user signs up and then an activation link is sent to the user email id for activating his/her account. Now I need to send an another email to the user, only after he logs in for the first time in my site, then the second email should be sent. Can anybody give me some suggestion on how to do it ?? NB: When the user clicks on
2008 Jun 04
2
Mock with an attributes that has state
I''m developing a rails application. I have an Order model that has_many OrderItems. I mocked the OrderItem model in my Order specs using mock_model. I thought I should focus my specs on each model and always mock associated models. In my Order model I need a way to merge OrderItems which have the same cost and same product_id. That I can spec. The other thing this merge helper
2008 Jan 05
3
Builder Plugin vs. Rails Plugin vs. ??? for one-click deploy
This morning I sat down to try to start writing a cruise plugin that allows you to deploy (''cap deploy'' or something similar) a revision that has built successfully by clicking a link or button on the builds/show page. (I.e., something that satisfies http://jira.public.thoughtworks.org/browse/CCRB-55.) Since I want to be able to configure the command to run in each
2008 May 23
8
version 1.3 build log truncation
Hi All, I have upgraded to verion 1.3. Our build output has huge text in it and what I notice is that in 1.3 the I do not see complete build.log. Is there any flag to control this? I want to see the complete build output because the last few lines has interesting output about what part of build failed. Thanks and Regard, Manish
2008 Jan 26
6
UI Integration with RSpec?
Hi all, Is there any integration with testing tools such as RSpec or Test::Unit planned? I see that the cruise task is run correctly, but the tests show up underneath the build log. Ideally I''d like them to show up the same way that they do in ''java'' CruiseControl, in their own section of tests. Will.
2008 Apr 29
1
Spec''ing controller macros
Hi, (This is my first post after months of appreciative lurking...) I''m trying to spec the following conditional controller macro: class ApplicationController < ActionController::Base # turn off session management for robots session :off, :if => lambda {|req| req.user_agent =~ /(Google|Slurp)/i } # ... end My current attempt seems to be quite unsuccessful: 1) when I
2008 Jan 11
5
Missing methods
We have a custom implementation of the Mother Object idea. It''s inside of a module, basically like this: module Factory %w(account friendship person invitation message asset email_address birth).each do |klass| eval <<-EOF def self.create_#{klass}(attributes = {}) default_attributes = valid_#{klass}_attributes #{klass.camelize}.create!
2008 Jun 04
5
controller filters running twice in 1.1.4?
since upgrading to 1.1.4 (I had been running without issue on a git snapshot), I''m noticing that my filter actions initiated from application.rb seem to be running twice. I created a test rails project with the rspec scaffold and am also seeing the same behavior here too. Adding this code to application.rb: before_filter :foo def foo "foo" end and an example
2007 Nov 12
1
help debugging ActionMailer with restful_authentication?
In a nutshell, I''m using restful_authentication that emails the user when they sign up for an account The development.log file shows the body of the e-mail message being prepped to send out, but doesn''t show confirmation that it made it. When I use gmail''s SMTP server, a Rails exception is thrown because gmail expects an encrypted connection. A different type of Rails
2007 Aug 30
8
experimental rails story adapter in trunk
For those of you interested in getting a jump on learning about and using the new Story Runner in a Rails app, I''ve added an experimental Rails-Story adapter to trunk. You can see how to use it here: http://pastie.caboo.se/92320 This is PURELY EXPERIMENTAL, however it actually works and will likely not change much in the way that it does work. Happy hacking! David
2008 May 03
5
Need some help in reducing my repetions in tests with Mocha
Hi All I''m writing a gem to interact with the todoist JSON API and I''m using mocha to mock the server responses so I don''t have to have a net connection to test and so I don''t need to actually use my own API key anywhere. Mostly I am interested in verifying that a correctly formatted URL has been sent, with the appropriate parameters, e.g API key have been
2008 May 18
2
Using Hash to mock classes that respond to :
Hi I''ve been doing this a while now. If I have a class that responds to : [], and all I''m interested in stubbing is that method, then instead of using a mock I just create a hash. (Similarly, you could create an array when you are testing an Enumerable object.) Example from code I just worked on, where uses MigrationGraph#[] looks up graph vertices by name:
2007 Apr 09
5
highlight crashes
I am trying to use highlight, but I am getting this kind of thing: /usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.4/lib/ferret/index.rb:197:in `highlight'': IO Error occured at <except.c>:93 in xraise (IOError) Error occured in index.c:1222 - lazy_df_get_bytes len = -5, but should be greater than 0 from
2007 Sep 21
3
Standardize environment between specs containing class defs
I have some specs that involve the use of eval and class definitions to test code generation. I want to always start with a clean slate so none of my tests fail or succeed incorrectly due to artifacts left over from previous specs. Example of my situation Spec 1 defines class Fish class Cod < Fish Spec 2 defines class Animal class Cod < Animal In this situation the
2006 Jun 11
7
testcase_setup_and_teardown_with_blocks (aka "The plugin with the very long name")
Hey all, I got annoyed recently that I couldn''t specifiy multiple chunks of test setup and teardown code that get executed for each test. You''re currently limited to just one setup method (unless I''m much mistaken). Anyway, I just wrapped up my solution in a plugin. The answer: use blocks! class Test::Unit::TestCase # This is overridden by the subclass and will
2012 Nov 02
2
Merge data frame with mispelling characters
Hello dear R-helpers, I'm working with R-2.15.2 on Windows 7 OS. I'm stucked with a merge of two data frames by characters. In each data frame I got two different list of names, that is my main-key to be merged. To figure out what I'm saying, I build up a modified "?merge" example, with errors by purpose: # Data for authors: authors <- data.frame( surname =
2009 Jul 02
1
Quantitative Risk Management by McNeil
Dear Specialists in R, May be somebody has experiment in using pakage for the book Quantitative Risk Management by McNeil? This package is writen in R. I have run this package for fitting the data to Nornal Inverse Gaussian distribution and fased with following problem. > Return<-read.csv("data.csv") > Transpose<-t(Return) > fit.NH(Transpose, case="NIG",
2000 Jul 11
2
Administering SWAT using userid's other than root...
Hi all... Has anyone got SWAT administration working from other userid's other than root? I've got a rh6.2 box running Samba 2.0.7. I have myself (wkim) in the "domain admin users" and the "admin users". Both the smb.conf file and the swat binarary are owned by root:swat. I'm a part of group "swat". (I'm also a part of group "root" just to
2011 Sep 07
4
rspec testing inheritance
Hello, Is there any way to test model inheritance in spec? something like.. it { ChildModel.should < ParentModel } thanks.
2014 Jun 25
2
How to enable EDAC kernel module for checking ECC memory?
In order to support ZFS, we upgraded a backups server with a new, ECC motherboard. We're running CentOS 6 with ZFS on Linux, recently patched. Now, I want to enable EDAC so we can check for memory errors (and maybe PCI errors as well) but so far, repeatedly pounding on the Google hasn't yielded exactly what I need to do to enable EDAC. One howto was covering PCI and edac, but