Displaying 20 results from an estimated 600 matches similar to: "[RAILS] - 2.3.3 creating a sea of red"
2009 Sep 22
4
rspec-rails and rack middleware
It doesn''t seem like my controller specs are calling my middleware on
requests. Has anyone figured out a good way to test middlware with rspec?
I''m thinking something like
rails'' rails/actionpack/test/controller/session/mem_cache_store_test.rb but
with rspec... any thoughts?
Thanks!
Best,
Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
2009 Feb 06
6
RecordNotFound bubbling thru to cucumber
Hello,
I have a controller action that raises a RecordNotFound exception if
you''re not allowed to see something. In my global application
controller (application.rb), I catch these and render the 404
template. But when I run cucumber (using webrat), it''s getting the
full stacktrace (the step blows up). Any ideas why? I have
consider_all_requests_local turned off in my test.rb.
2009 Oct 14
14
spec-ing private methods?
On Wed, Oct 14, 2009 at 5:49 PM, Scott Taylor <scott at railsnewbie.com> wrote:
>
> On Oct 14, 2009, at 3: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 complex_method...
2009 Sep 30
10
Can't run specs after upgrading gems... get 0 tests, 0 assertions...
So after I updated all my gems, I started getting:
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/
dependencies.rb:105:in `const_missing'': uninitialized constant
Test::Unit::TestResult::TestResultFailureSupport (NameError)
from /Library/Ruby/Gems/1.8/gems/test-unit-2.0.3/lib/test/unit/
testresult.rb:28
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
2008 Nov 06
3
Verifying some understanding about manipulating DB data in before/after callbacks in RSpec
We had an after(:each) callback that looked like this:
PurchaseOrder.find(:all).each {|po|
DraftInvoice.find_all_by_po_number(po.po_number).each {|di| di.destroy}}
which we were hoping would reset some purchase order data in a certain way.
However, because we have "self.use_transactional_fixtures = true" set in
test_helper.rb, this code was never getting committed.
So, I just
2009 Oct 06
3
rspec-rails 1.2.9 Released
rspec-rails version 1.2.9 has been released!
* <http://rspec.info>
* <http://rubyforge.org/projects/rspec>
* <http://github.com/dchelimsky/rspec-rails>
* <http://wiki.github.com/dchelimsky/rspec/rails>
* <rspec-devel at rubyforge.org>
Behaviour Driven Development for Ruby on Rails.
Changes:
### Version 1.2.9 / 2009-10-05
* enhancements
* added route_to and
2009 Sep 20
11
describe block proc parameter as alternative to before blocks?
I''ve been reading through the Rspec book to see if I missed any
tricks, and the discussion of before block use for context setup in
sec 12.6 struck me as interesting and something I had a knee-jerk
reaction to.
I think that when you are using nested examples to describe a context
change it is bad practice to allow any example within that group to
run outside of that context. This could
2007 Oct 12
6
abstract_class... what exactly does it do
Hi,
Does anyone know much about abstract_class? Does it actually prevent
instances of the class from being created? Does it disable certain
methods? I already know what it''s for, but I want to know what setting
self.abstract_class=true actually does.
The reason I ask is that I want to use it for a slightly unorthodox
purpose. I want a class who''s only attributes are its
2007 Sep 29
8
Inheritance problem in model
Hello,
I''ve got a problem with the inheritance as soon as I try to use it in a
model.
I''ve got plenty of items which can share a lot of code, so I created a
class "Item", which inherits from ActiveRecord::Base, but because it''s
not a "real item" but an interface, I set it abstract (writing
abstract_class? method).
Then I have all the differents
2011 Dec 03
1
ActiveRecord Abstract class
Hi, I was trying to create an abstract class and a subclass which
inherit that abstract class.
However, seems like I cannot instantiate the subclass too. Below is my
code:
//abstractclass2.rb
class Abstractclass2 < ActiveRecord::Base
self.abstract_class = true
end
//subclass.rb
class Subclass < Abstractclass2
end
When I test drive it in rails console, I got the following error:
2009 Oct 20
8
Stub that returns hash values
Is it possible to create a stub that returns hash values.
For example I would like to convert this:
@siteItem = stub(''plmSiteItem'', :one => "uno")
To something like this:
@siteItem = stub(''plmSiteItem'', {''one'' => ''uno'', ''two'' => ''dos''} )
So that I can do this:
2006 Aug 24
0
Model with self.abstract_class=true allows save method call
I think this is a bug.
I declared a model with self.abstract_class = true and then tried to
call save on it and it attempted the save. I think this should raise a
"method not allowed" exception of some sort.
Where is the Trac system that I would use to report this?
Thanks,
Wes
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You
2012 Dec 08
2
file.link on Windows 7
Hello,
A post to R-Help by Oliver Soong reports what seems to be a bug specific
to Windows (I'm on Windows 7).
The original post is as follows:
----------------------------------------------------------------
from: Oliver Soong <osoong+r at gmail.com>
to: r-help <r-help at r-project.org>
date: Fri, 7 Dec 2012 22:07:49 -0800
subject: [R] file.link fails on NTFS
Windows 7 64-bit,
2013 Mar 14
3
Error: did not find expected key while parsing a block mapping
I run test:
test:units
lass ProductTest < ActiveSupport::TestCase
test "product attributes not be empty" do
product = Product.new
assert product.invalid?
assert product.errors[:title].any?
assert product.errors[:description].any?
assert product.errors[:price].any?
assert product.errors[:image_url].any?
end
test "price musst be
2012 Mar 02
0
ConnectionNotEstablished when using connection on AR::Base abstract subclass
I''m using AR outside of Rails and calling establish_connection on an
ActiveRecord::Base abstract_class subclass (to protect my connection
in case anyone else is using AR). It was working just fine with AR
3.0.9, but I recently attempted to upgrade to AR 3.2.2. Now, when I
hit a "nested" query from a has_many, I get a
ActiveRecord::ConnectionNotEstablished. If I call
2010 Jul 27
0
Rails 3.0.0.rc1 update - issue w Bundler 1.0.0.rc.1 and ruby 1.9.2.rc1
I upgraded my rails 3 version (now using bundler-1.0.0.rc.1
but bundle install in my test_app raises an error :
bundle install
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
...
Using railties (3.0.0.rc)
Using rails (3.0.0.rc)
Updating .gem files in vendor/cache
/Users/yves/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rubygems/package/
tar_input.rb:111:in `initialize'': No
2012 Dec 29
0
no metadata found in activereocrd-3.2.9.gem when running bundle install in a rails 3.2.9
m a newbie in rails. working on Windows 7, 64 bits. Installed my
environment through RailsInstaller. latest version ofcourse. When creating
a new project, (keeping the gem file as default) and having the bundle
install run, am getting the error
gem::package::FormatError: no metadata found in
D:/RailsInstaller/Ruby1.9.3/bin/cashe/activereocrd-3.2.9.gem
and error occurrend while installing
2012 Oct 31
0
file.symlink() creates zero-size file/link on Windows 7/NTFS/admin
With R 2.15.2 patched (2012-10-29 r61044) and R devel
(2012-10-29r61044) on **Windows 7 w/ NTFS ** running in admin mode, I
get:
EXAMPLE:
> cat("Hello world", file="foo.txt")
> file.exists("foo-lnk.txt")
[1] FALSE
> res <- file.symlink(from="foo.txt", to="foo-lnk.txt")
> warnings()
NULL
> res
[1] TRUE
>
2005 Dec 12
2
Using a lib in YAML fixtures
I''m using the runt library [1] to do some temporal expression
matching. I want to keep the expression in a binary field in my db.
I figured that then in order to do the fixtures, I''d need to do some
erb in the yaml file. So I came up with this:
onetime:
id: 1
name: One Time
description: This event occurs only one time.
timex: <%= REYear.new(7) & REMonth.new(24)
2015 Apr 22
2
Lossless stream from MPD...
I am not familular with liquidsoap. Is it something I can use with MPD?
On Wed, Apr 22, 2015 at 1:10 PM, Eduardo Martinez <erm13martinez at gmail.com>
wrote:
> Icecast can definitly handle OggFLAC. I usually use liquidsoap to stream
> flac to icecast.
> On Apr 22, 2015 12:52 PM, "David Martinez" <david at sojournmusic.net> wrote:
>
>> Any way to setup a