Displaying 20 results from an estimated 3000 matches similar to: "params not available for controller specs?"
2007 Dec 03
5
spec for model_id should eql
Hello,
I''m confused why the spec described below is failing. Other simple
comparison specs are passing fine for the same model. The code is working
accordingly when I test it through the console, I''m just having difficulty
getting this spec to work. Any pointers would be appreciated.
Failure message:
''Address fetch and geocode should extract department and write to
2008 May 03
6
Everyone Using Rspec Autotest?
I haven''t been spec''ing lately, but been hopping back on and adding
autotest.
However I get an error:
http://pastie.caboo.se/177538/wrap
I also noticed a post by Scott and there was mention of rspec_autotest.
Is this is what everyone is using?
http://svn.caldersphere.net/svn/main/plugins/rspec_autotest/
2007 Sep 13
2
Failing to raise an exception in a stub
I''ve come across rather strange behaviour when trying to raise an
exception in a stubbed method.
I''m speccing the behaviour of a Rails create action, where I''m using
save! to catch failed saves. In the case of working save, I''m using
the following stub:
@client.stub!(:save!).and_return(true)
which works fine.
However, in the negative case,
2006 Dec 20
2
OSX Dashboard Widget for managing mongrels...
Hey everyone -
I recently switched to using a Mac and have several different rails
projects going and was getting tired of starting/stopping mongrels via the
shell so wrote my first dashboard widget to do it for me.
More details at the URL below...
http://blog.pjkh.com/2006/12/20/mongrel-rails-dashboard-widget
Hope those of you on OSX find it handy... feels good to finally give
something
2007 Nov 20
2
confirming that a model instance was correctly created from POST params
I''m wondering whether I''m wasting my time trying to verify that an addition I''ve made to legacy code is in fact setting a new attribute on a model.
Substruct''s (http://dev.subimage.com/projects/substruct) OrderHelper contains this method:
1 def create_order_from_post
2 @use_separate_shipping_address = params[:use_separate_shipping_address]
2007 Nov 13
2
Spec slowdown
Is there something currently going on on the rspec trunk that causes
a massive slowdown when running rake spec and autotest (without
spec_server)? I updated to the latest trunk yesterday and the time
needed to run the specs of my app jumped from ~20 seconds to more
than a minute. The weird thing is that if I run the rake spec tasks
separately (controllers, models, views, helpers), they
2008 May 20
4
mock_model not stubbing model attribtues in view spec
Hi -- I am just getting to grips w/ view specs, and am having an issue
with mock_model not stubbing the mocked model''s attributes.
For instance, I have the following:
<CODE>
before do
@input_timesheet = mock_model( InputTimesheet )
assigns[:input_timesheet] = @input_timesheet
end
it "should display a table element" do
render
2007 Sep 30
9
Problems with testing nested routes using mocking
Hello forum
I have there to files
#----- virtual_host_controller.rb
class VirtualHostsController < ApplicationController
before_filter :capture_domain
# GET /domain/1/virtual_hosts/1
def show
@virtual_host = @domain.virtual_hosts.find(params[:id])
respond_to do |format|
format.html # show.rhtml
end
end
private
def capture_domain
if
2008 May 26
7
Mocking Models in Controller Specs...
I find myself doing this kind of thing a lot in Controller Specs:
@vacancy = mock_model(Vacancy)
@vacancy.stub!(:reference)
@vacancy.stub!(:title)
@vacancy.stub!(:created_at)
@vacancy.stub!(:updated_at)
@vacancy.stub!(:body)
@vacancy.stub!(:contract)
@vacancy.stub!(:location)
@vacancy.stub!(:salary)
@vacancy.stub!(:benefits)
2007 Sep 13
5
Authenticating before tests
Hi all,
I''m using Goldberg, an engine that provides roles based access
control for my app. I need to login before I can do controller tests,
but I can''t find any examples of people doing this.
Could someone point me in the right direction?
I thought the simplest way would be to either call the login action
from my other tests before(:all), but I can''t seem to
2007 Feb 08
7
Informal benchmarks - apache, mongrel, etc
I see that Brian McCallister did some benchmarks recently, showing
Apache, Mongrel, Jetty and TwisteWeb:
http://kasparov.skife.org/blog/src/ruby/silly-micro-benchmarks.html
Regards,
Dan
This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received
2007 Nov 21
7
describe AddressesController, "handling GET /addresses" do
Hello,
I''m working with scaffold generated controller test code for handling GET
requests. Address is the model being tested. Address belongs_to Company,
Company has_many addresses.
In my addresses_controller I have:
before_filter :get_company
def index
@addresses = @company.addresses.find(:all)
respond_to do |format|
format.html # index.html.erb
format.xml {
2007 Nov 20
1
How to represent Story of Life grid in Then clause
In this story from Dan''s Game of Life:
Scenario: the grid has three cells
Given 3 x 3 grid
When I create a cell at 0, 0
And I create a cell at 0, 1
And I create a cell at 2, 2
Then the grid should look like:
XX.
...
..X
How do you set up matchers for the grid at the end. Are all the
indented lines after a Then passed to the Then matcher as separate
2007 Jul 26
1
Prototype 1.5.1.1. bug, "too much recursion" line 1294
FYI, just tried to upgrade my prototype from 1.5.something to 1.5.1.1
and when I did an ajax based form submission, I my browser pegged the
CPU. FireBug tells me there is too much recursion online 1294:
if (!element || !element.tagName || element.nodeType == 3 ||
I don''t have enough time to submit a proper bug report but wanted to
let people know.
2007 Jan 03
1
Added :group option to paginate method
Ok, nothing really difficult, I add the possibility to call the
paginate method
with the :group option.
Please, someone can tell me how to submit this patch?
Thanks
Sandro, sandro@railsonwave.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To post to this group, send
2008 Oct 16
2
Any good conferences this year about ruby/rspec/watir?
Hello.
Sorry for this little offtopic question, but I was wondering if anyone
happens to know if there''s any good conferences coming up about rspec or
ruby or watir in this year where I could attend to?
Or any good website where such things are listed or something similar.
All suggested conferences should not take place before one month from now
(employer needs some time to get good
2008 May 03
11
Date comparisons
I occasionally get this error:
1)
''A puzzle once featured, should no longer be nominated'' FAILED
expected: Sun May 04 09:10:26 -0700 2008,
got: Sun May 04 09:10:26 -0700 2008 (using ==)
./spec/models/puzzle_spec.rb:180:
So, the dates looks the same to me. Any ideas for how to debug?
Joe
2007 Sep 14
2
Testing a nested controller
Hey everyone.
I really stuck on testing a nested controller. I''m trying to make a
request using get and afterwards checking the response by
response.should ...
My routes.rb looks like this:
map.resources :writers do |writers|
writers.resources :notes
end
In my notes_controller_spec.rb
def do_get
writer_id = 1
note_id = 1
get note_path(writer_id, note_id)
end
it "should show
2007 Nov 20
3
How to test views with Nested Resources and Partials
Hi everyone,
I am relatively new to rspec and I am running into a wall in testing my
views. I have a RESTful resource Contracts with a nested resource of
Line_items.
I am trying to figure out how to test the "edit" form of the Line_items.
What complicates this is the nested routing and how to account for it,
and that there is a partial form (_form.haml) that both the edit.haml
and
2007 Oct 26
2
Examples of writing controller specs that use authentication
Hello,
I''m working on specs for a controller that handles authentication
using the restful_authentication plugin. I''m trying to find a
resource (tutorial or examples, if possible) about the best way to go
about writing mocks and specs to make sure that things like my
before_filters are working correctly. Does anyone know of any good
resources for this?
Thanks,
Les