similar to: testing around_save

Displaying 20 results from an estimated 100 matches similar to: "testing around_save"

2011 Sep 19
14
gmaps4rails "acts_as_gmappable" error
Hi all, I started to see fun of gmaps4rails gem from https://github.com/apneadiving/Google-Maps-for-Rails. After everything done. When visited the locahost, i got the following error. undefined local variable or method `acts_as_gmappable'' for #<Class: 0x31a9da8> the error is due to i have line "acts_as_gmappable" in my model. Anybody knows how this is
2012 Feb 03
1
rails memoize and reload class => error raised
Hi, That''s a bit off topic but since I use Spork + Rspec... Well, my classes are reloaded between each test wave so Rails'' "memoize" method raises an error (which is expected, see code: http://rubydoc.info/docs/rails/3.0.0/ActiveSupport/Memoizable:memoize) Anyone resolved this issue with an elegant solution?
2008 Oct 26
3
Process dataframes from list
Hi all, I have roughly fifty dataframes and a dataframe with the names of the fifty dataframes. I want to perform the same set of manipulations on all fifty dataframes, but can't find a way to batch process from a list with the dataframe names using a loop. Is there a way to read the file names from the dataframe with the names and then call the referenced dataframe? This would save me a
2004 Sep 28
3
Truncated output from "rsync -e ssh ... 2>&1 | tee"
(Versions: OpenSSH_3.7.1p2, rsync version 2.6.2) I've just encountered a situation where "rsync -v -n" appears to run normally, but reports many fewer file transfers than actually get done when you remove the -n. (This is not one of the usual "-n" corner cases.) It turns out that this only happens when you're doing a remote rsync over ssh AND you redirect stderr into
2011 Sep 06
1
NETCON_secure_connect Error
First off...hi to everyone. I'm a new mac user but have some limited experience with Linux. I have wine installed on my mac and am attempting my first installation. I am trying to install RJOVantage on my mac. Here is what happened? $ wine setup.exe wine: created the configuration directory '/Users/brentschmidt/.wine' fixme:system:SetProcessDPIAware stub!
2012 Mar 10
6
Cartographer shows correct info box BUT over wrong marker
Hi guys (and gals), The code formatting is so nice on SO.com, so I thought I''d just share my post in hopes that someone from the group can help. http://stackoverflow.com/questions/9643786/cartographer-shows-correct-info-box-but-over-wrong-marker Feel free to answer back via email if you don''t have an SO account. Thanks! Abram -- You received this message because you are
2012 Apr 04
5
Simple code dosn't work
I think you have a syntactical error on the line thats throwing the error, you state: > j.even?should be true #throws an error on j == 2, j == 4 should this line not read as: j.even?.should be true -- Posted via http://www.ruby-forum.com/.
2008 Jun 12
2
Use of ''should'' in another thread
Hi, I''ve tried to find anything about using ''should'' within a Thread, but it is a little hard do look up there, so I hope you forgive-me if I am asking an "old question". I guess this spec should fail: describe Thread do it "must be fine" do Thread.new { true.should_not be_true } # Why don''t fail?! end end It seems that some
2011 Apr 16
0
[announcement] Google Maps + Rails 3 = gmaps4rails
Just FYI I created a gem to easily integrate google maps within Rails3: - geocode - display styled markers, polylines, polygons, destinations... There is much configuration to fit your needs. It was presented here: http://rubyshow.com/episodes/157 The source is here: https://github.com/apneadiving/Google-Maps-for-Rails Wiki is here: https://github.com/apneadiving/Google-Maps-for-Rails/wiki
2008 Apr 25
0
Spec migrations?
Dear list, I am in the process of writing on an app with is already running. I need to create a couple of structural database changes for which I use migrations. However I want to be absolutely sure I do not destroy any existing data. So RSpec is the way to go! Or so I thought. 1. dropped the test database. 2. create the database. 3. migrate to the version just before the critical migration
2007 Jan 27
1
Annoying Scale and DnD behaviour
Current behavior terminates scale when not moving cursor _between windows_. Shouldn't scale be terminated only when not moving cursor _at all_ for the specified time? Stjepan
2007 Oct 04
7
Using Predicates to look at an array..
Hi all, I have an array of shipping_type''s being returned, and I want to see what is in there. In the past I have done: shipping_type.include?(Cart::SHIPPING_TYPE_REGULAR).should be_true This works, but looks really ugly.. It just doesn''t roll of the tongue very well. I then looked up the use of Predicates, which I had been using, but hadn''t realized:
2012 Sep 15
2
[RSpec Testing] Methods take two arguments
Hello, Here is my *pdf_helper.rb* => http://pastebin.com/QU1kTKXk. I want to test, if self.create method can take more than two arguments. But, when I try to run my test. It showed *PdfHelper Should have two arguments Failure/Error: create_pdf.should_receive(object,template).with(user,file) NameError: undefined local variable or method `create_pdf'' for
2007 Jul 31
11
helper spec not finding rails core helpers
Hi, My helper specs were going ok until I added a call to a rails DateHelper method in one of my helpers http://api.rubyonrails.com/classes/ActionView/Helpers/ DateHelper.html#M000574 The helper runs fine from my view templates, just dies in the spec test. I boiled my question down to a simple (not too useful) example. I''m not sure what I''m missing. #
2008 Jun 05
1
Using and_yield to pass multiple or no iterations
Hi, imagine there''s a class called Egg which has the following method (which calls another method): <CODE> def do_thing has_iterated = false self.each_row do |row| has_iterated = true unless has_iterated end has_iterated end </CODE> Stupid code, I know. I have two questions with it. The first is, would it be possible to set it up to test the case when each_row
2008 Aug 27
3
array_including()
I found myself having to write this today: class ArrayMatcher def initialize(array_to_match) @array_to_match = array_to_match end def ==(other) ok = true @array_to_match.each do |item| ok = ok and other.include?(item) end ok end end def array_including(array_to_match) ArrayMatcher.new(array_to_match) end Is there already something in the
2011 Mar 03
1
Does RSpec interfere with Pathname#dirname or Pathname#realpath ?
Hi, I starting a new project, and have run into behavior I cannot replicate in irb, (i.e. outside of using rspec) when the directory? returns true, so I thought I''d ask here, in case any one has seen this badhavior. ruby-1.9.2-p136 rspec (2.5.0) rspec-core (2.5.1) rspec-expectations (2.5.0) rspec-mocks (2.5.0) When I try to run this spec: require Pathname(__FILE__).ascend { |d|
2007 Sep 04
3
Model Specs: Fixtures vs Mocks + Stubs?
What is the general opinion about fixtures versus mocking and stubbing in model specs? I heard from agile on IRC that they save the database testing for integration testing, but I also see that the caboose sample applicaiton uses fixtures. I also noticed that on the rspec site, it says "Ironically (for the traditional TDD''er) these are the only specs that we feel should actually
2007 Apr 13
1
File.should be_exist?
Hi! Is there a nicer way of writing File.should be_exist(''filename'')? File.should exist(''foo'') throws NoMethodError in ''specification'' undefined method `exist'' for #<#<Class:0x3ec1c30>:0x3ebc308> (I''m using rspec from the trunk) Esad
2009 May 19
0
View testing (rspec/selenium) - test if a file link works
I have a ''download'' link on one page that causes a zip to be built and then pushes it back as a file to the browser. I want to write a test to verify that it does actually push a zip file back but i can''t work out how - can anyone help? I''m using rspec and selenium. The line to click the download link looks like this: @browser.wait_for_then_click