Displaying 20 results from an estimated 1100 matches similar to: "Migrating spec_helper with modifications"
2007 Mar 15
5
rake spec:views no transaction error
Hello,
I have recently upgraded to the 0.8.2 release of rSpec, and I am receiving
the following message with each view spec execution:
WARNING: there is no transaction in progress
I have upgraded the rspec_on_rails plugin as well, and both the model and
controller tests are working flawlessly. Is there some simple step I
missed? thanks for the input.
-Chris
-------------- next part
2006 Nov 24
13
rSpec on Rails 1.2?
I just updated my Rails install to the most current Edge and my
controller specs fail:
1)
TypeError in ''The User Controller should be a user controller''
can''t convert nil into String
Each spec fails the same way.
<context string> <spec string>
can''t convert nil into String
Any ideas what''s up with this?
Thanks,
s.ross
2007 Apr 11
10
DRYer controller specs
So, I''ve been following the recommendations for controller specs here:
http://blog.davidchelimsky.net/articles/2006/11/09/tutorial-rspec-stubs-and-mocks
Most notably: a single expectation per specify block; the setup block
contains only stubs; mock expectations each get their own specify
block. (I''m still using 0.8, so I haven''t gotten the describe/it
goodness yet.)
I
2012 Jun 08
1
[Rails 3.2.5] Rails: unit test fixture_path : fixture_file_upload cannot find the file ...
I am trying to perform a test unit, using FactoryGirl
include ActionDispatch::TestProcess
FactoryGirl.define do
factory :article do
.......
photo { fixture_file_upload ''/files/test.jpg'', ''image/jpg'' }
end
end
IN mt test_helper.rb I defined the fixture_path
def fixture_path
File.dirname(__FILE__) + "/fixtures/" #
2007 Nov 09
9
fixture_file_upload and edge rspec?
Hi all,
I had some specs that were using fixture_file_upload that were
passing just fine. Then I froze edge rails to get some 2.0
functionality, then a I upgraded to trunk rspec to deal with
uninitialized constant ActionView::Helpers::JavaScriptMacrosHelper
After a couple other of tribulations, I have now gotten down to just
a couple of not passing specs, all using the fixture_file_upload.
2007 Jan 17
1
include ClassMethods in plugins
Why is that in so many plugins I see people using (including
acts_as_taggable by DHH):
# init.rb
ActiveRecord::Base.send(:include, ActiveRecord::Acts::SomeModule)
# lib/some_module.rb
module ActiveRecord
module Acts
module SomeModule
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def acts_as_something
# code
2005 Aug 10
1
using modules with models?
I''m trying to figure out how to use modules with my model classes.
I''m going to have good number of model classes that don''t map to the
database, and I''d like to put some of these in seperate modules. I''ve
been wrestling with this for 2 days and can''t figure out how to get it
to work. Rails seems to handle it fine for controllers, though.
I
2007 Feb 13
16
Error against latest trunk while testing via spec for model
Hi
I just did an update to lates trunk
=================
context "Given a generated venue_spec.rb with fixtures loaded" do
fixtures :venues
specify "fixtures should load two Venues" do
Venue.should have(2).records
end
end
==================
gives me
==========
1)
TypeError in ''Given a generated venue_spec.rb with fixtures loaded
fixtures should load two
2008 Feb 18
5
uh... fixtures?
RSpec-ers:
I''m aware this is quite the FAQ. I have probably asked it myself, but I just
can''t Google up anything but others asking it.
I grabbed the source to Beast, to use as a Rails project uninfluenced by me, or
RSpec. Then I installed the CURRENT version of RSpec and rspec_on_rails, and set
up a model spec on Post.
Here''s the spec_helper.rb lines:
2015 Oct 27
3
Add a mapping to a C++ lambda
Apologies for the noop question in advance (just getting started with
LLVM), and I'm not entirely sure if this is the right list to post to. is
it?
I have some lambda functions as member variables that I want to have my
LLVM language make calls to. I've added a mapping to them, but this doesn't
seem to enable LLVM to resolve the functions. I asked on stackoverflow but
the suggestion
2008 Dec 03
5
How to test a plugin
Guys,
I''ve created a plugin, i wanna put my automated test there.
However, I got bad file descriptor error when i run the test like normal
unit test file:
"ruby plugins/acts_as_fox/test/acts_as_fox_test.rb"
How to test a plugin?
Also, is it right to say that I should only put my unit tests (but not
functional test for example) for the plugin in the plugin test folder?
2007 Jul 09
12
Mocking User.find( :all, :limit => 10 )
Hi,
I''m trying to setup a mock for my controller test but I can''t get it to
recognise the mock.
I use
it "should find all users" do
User.should_receive(:find).with( :all, :limit => 10
).and_return([@user])
do_get
end
and in the controller
@users = User.find(:all, :limit => 10 )
But this does not work. It gives me
User expected :find with (:all)
2008 Nov 27
3
How to parse info from an xml response
Hi all!
In my app I want to detect what country a visitor is viewing from by
their IP.
Although it''s by no means perfect, the simplest option I''ve found is
by using this site:
http://api.hostip.info/
by passing the ip address as a query, this site returns an xml file
with the country as one of the tags.
http://api.hostip.info/?ip=6.255.255.255 returns (amongst other
things)
2007 May 10
5
Shared behavior and_raise problem, and site aestetics
Hello,
Is anyone else having trouble with the and_raise method on mocks,
with respect to shared behaviors? If I do the following instead:
foo.should_receive(:bar).and_return { raise }
everything seems to work. I have been supplying no arguments to
and_raise, by the way.
Also, you may want to make the background in the code examples on the
home page a little lighter. I am hardly able to
2007 Sep 10
1
Using Rspec with ScenarioFixtures
I am currently trying to get Rspec to work with ScenarioFixtures.
http://code.google.com/p/fixture-scenarios/
http://errtheblog.com/post/7708
I did a quick search and didn''t find any mention that any one else had
gotten this to work yet. If i missed something, could you please drop me a
line.
Otherwise, expect a progress report when i get this working...
Bret
-------------- next part
2006 Nov 25
2
RSpec 0.7.3
Hi all,
I just released RSpec 0.7.3. It''s got a few bug fixes and the rails
plugin *should* run against both Rails 1.1.6 and 1.2.0-RC1.
If you run into problems, please report bugs and feature requests in
the tracker at rubyforge:
http://rubyforge.org/tracker/?group_id=797
Cheers,
David
2007 May 04
11
spec template for CRUD?
Hello,
Has anyone already come up with a set of shared behaviours that
someone could leverage when adhering to a CRUD concept, with respect
to controllers?
Relatedly, it would be nice if there were a way to share generalized
behaviour specs.
-Chris
2007 May 03
3
0.9.2 redirect_to no longer accepts hash?
Why am I now getting these errors?
expected redirect to {:action=>"index"}, got redirect to
"http://test.host/authenticated_users"
I know in the AuthenticatedUsersController, the redirect call is
redirect_to :action => ''index''
So why should I have to convert this to a url in my specs?
2006 Mar 25
6
Polycom IP 301 is slow
Hi guys, I've been using a Polycom IP 301 for a couple of weeks now and
find that it's extremely slow for configuring. For instance, it takes
several minutes to boot up, apply any changes via the web interface takes
at least a minute, etc. Is this normal behaviour? Is there anything that
can be done about it?
Thanks,
-- Nick
e: nick.hoffman@altcall.com
p: +61 7 5591 3588
f: +61 7 5591
2007 Apr 30
3
svn head api url?
Hello,
Is there a url for the api used on the development branch, which gets
updated per commit or so? I am using rspec as a plugin, complete with the
externals property, and would like to refer to the new api while I fix all
my specs up. Thanks.
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: