Displaying 20 results from an estimated 22 matches for "mingins".
2007 Aug 01
3
Test Rendering nothing in Rails
Hi
In a controller I have method that is accessed via an AJAX call and
will conditionally do:
render :nothing => true
to test the condition hitting this line I was hoping to do something
like:
response.should render_template(:nothing)
How should I test this behaviour?
Cheers
Shane
2007 Oct 05
4
have_xml_tag
Hi
Was just using have_tag on an xml response and found the problem
outlined and resolved here
http://weblog.jamisbuck.org/2007/1/4/assert_xml_select
Just wondered if there is any support in rspec?
Cheers
Shane
Shane Mingins
ELC Technologies (TM)
PO Box 247
Santa Barbara, CA 93102
Phone: +64 4 568 6684
Mobile: +64 21 435 586
Email: smingins at elctech.com
AIM: ShaneMingins
Skype: shane.mingins
(866) 863-7365 Tel - Santa Barbara Office
(866) 893-1902 Fax - Santa Barbara Office
+44 020 7504 1346 Tel - London Offi...
2007 Nov 21
2
When you sometimes wonder how to test this??
...g at the
Rails test suite.
At the moment I am working on testing our custom error_messages_for
methods and I have found looking at how the Rails tests in
active_record_helper work helpful :-)
So just thought I''d share that. Have other''s done the same?
Cheers
Shane
Shane Mingins
ELC Technologies (TM)
1921 State Street
Santa Barbara, CA 93101
Phone: +64 4 568 6684
Mobile: +64 21 435 586
Email: smingins at elctech.com
AIM: ShaneMingins
Skype: shane.mingins
(866) 863-7365 Tel - Santa Barbara Office
(866) 893-1902 Fax - Santa Barbara Office
+44 020 7504 1346 Tel - Lon...
2008 Mar 14
2
Lib Specs and config.use_transactional_fixtures = true
...have specs in our rails project other than model/view/controller ..
we have interests and lib ...
using use_transactional_fixtures = true seems fine in a spec in the m/
v/c and interests directories but not in lib
Just wondered if anyone had any quick thoughts as to why that may be???
Shane Mingins
ELC Technologies (TM)
1921 State Street
Santa Barbara, CA 93101
Phone: +64 4 568 6684
Mobile: +64 21 435 586
Email: smingins at elctech.com
AIM: ShaneMingins
Skype: shane.mingins
(866) 863-7365 Tel - Santa Barbara Office
(866) 893-1902 Fax - Santa Barbara Office
+44 020 7504 1346 Tel - Lon...
2007 Dec 17
2
RSpec 1.1.0 (Rails) --- Supported Rails Versions?
Hi
Just a quick question .... what backward versions of Rails will the
1.1.0 versions of RSpec and Spec::Rails support?
I think I maybe under the (incorrect) impression that I had to go to
Rails 2.0 for 1.1.0
Cheers
Shane
Shane Mingins
ELC Technologies (TM)
1921 State Street
Santa Barbara, CA 93101
Phone: +64 4 568 6684
Mobile: +64 21 435 586
Email: smingins at elctech.com
AIM: ShaneMingins
Skype: shane.mingins
(866) 863-7365 Tel - Santa Barbara Office
(866) 893-1902 Fax - Santa Barbara Office
+44 020 7504 1346 Tel - Lon...
2007 Oct 25
3
Mocking Workers in Backgroundrb
..._email_worker, :args => params
[:email])
I cannot seem to find the correct manner to do it.
Would have liked to be able to do MiddleMan.should_receive
(:new_worker).with(:class => :admin_email_worker, :args => {"body" =>
"my message"})
Cheers
Shane
Shane Mingins
ELC Technologies (TM)
1921 State Street
Santa Barbara, CA 93101
Phone: +64 4 568 6684
Mobile: +64 21 435 586
Email: smingins at elctech.com
AIM: ShaneMingins
Skype: shane.mingins
(866) 863-7365 Tel - Santa Barbara Office
(866) 893-1902 Fax - Santa Barbara Office
+44 020 7504 1346 Tel - Lon...
2007 Sep 04
7
1.05 to 1.08
...s an exception in 1.08 ... is seems that
the route helper method is not available.
BTW, in our actual code the call to weather_path is in the helper ...
I just put it in the above for simplicity.
So I am wondering what may have changed and what do I need to
configure??
Thanks
Shane
Shane Mingins
ELC Technologies (TM)
PO Box 247
Santa Barbara, CA 93102
Phone: +64 4 568 6684
Mobile: +64 21 435 586
Email: smingins at elctech.com
AIM: ShaneMingins
Skype: shane.mingins
(866) 863-7365 Tel - Santa Barbara Office
(866) 893-1902 Fax - Santa Barbara Office
+44 020 7504 1346 Tel - London Offi...
2007 Oct 04
3
Is stubbing a call to super possible?
...s controller ... part of the logic
flow calls super which calls the method authorized in the application
controller.
As I am focused on the logic of the method in the controller I am
testing I just wish to stub the value returned in the super.
Is this at all possible?
Cheers
Shane
Shane Mingins
ELC Technologies (TM)
PO Box 247
Santa Barbara, CA 93102
Phone: +64 4 568 6684
Mobile: +64 21 435 586
Email: smingins at elctech.com
AIM: ShaneMingins
Skype: shane.mingins
(866) 863-7365 Tel - Santa Barbara Office
(866) 893-1902 Fax - Santa Barbara Office
+44 020 7504 1346 Tel - London Offi...
2007 Sep 25
4
Autotest with RSpec Rails and Engines
Hi
We have a Rails project using an engine which I want to run autotest
with rspec against.
So the project specific specs are in the specs directory but the
common specs are in the specs directory of the engine plugin (e.g.
vendor/plugin/engine/specs)
Just wondering where I would be looking to change configuration so
that autotest will also look for the specs in the engine directory?
2008 Mar 10
10
tutes on testing controllers
hello spec''ers,
i''m in the hunt for guides on testing controllers with rspec, would
you guys recommend any?
thanks
Oliver
--
Oliver Azevedo Barnes
oli.azevedo.barnes at gmail.com
+55 11 9768 0193
http://www.linkedin.com/in/oliverbarnes
http://workingwithrails.com/person/4704-oliver-barnes
2007 Oct 28
4
A better way to stub out constants
Hi
Something that''s gnawing at me... to avoid using the SQLite3 gem I''m
stubbing it out like this:
before(:each) do
@database = mock("SQLite3 database")
SQLite3 = Module.new
SQLite3::Database = Class.new
SQLite3::Database.stub!(:new).and_return(@database)
end
But then it keeps nagging me:
2007 Dec 04
4
AutoTest / Rspec - "stack level too deep"
Hello,
I''m running AutoTest with Rspec on a Rails application.
Every 20 or so runs I get "stack level too deep" on one particular
controller stub.
Ex.
controller.stub!(:login).and_return(true)
This particular line is in a before block of a certain describe block. The
strange thing is, every single spec in this file fails on that one line,
even the specs in other describe
2008 Jan 11
0
Peepcode RSpec User Stories
http://peepcode.com/products/rspec-user-stories
Shane Mingins
ELC Technologies (TM)
1921 State Street
Santa Barbara, CA 93101
Phone: +64 4 568 6684
Mobile: +64 21 435 586
Email: smingins at elctech.com
AIM: ShaneMingins
Skype: shane.mingins
(866) 863-7365 Tel - Santa Barbara Office
(866) 893-1902 Fax - Santa Barbara Office
+44 020 7504 1346 Tel - Lon...
2008 Jan 30
9
catching errors, rspec basics
Trying to spec the following but don''t know if I''m using the right matcher.
How do I spec? Plz, sugar on tops.
Audience.stats
- should have a stats of 80 when passed a flux of 10
- should return an error when passed a string (ERROR - 1)
1)
TypeError in ''Audience.stats should return an error when passed a string''
String can''t be coerced into Fixnum
2007 Nov 30
4
Rendering a view and passing a variable
Hello all,
I have a view which display html based on the value of a variable. Here''s the code :
<% if @language == ''e'' %>
<%= link_to "Français", :action => :index, :id => "f" %>
<% end %>
In my test, I''m trying to set the value of the variable first, but that just doesn''t seem to work :
it
2007 Jun 11
2
Testing create in Rails controller
...1)
NoMethodError in ''AdminController should tell the Product model to
save a new product on POST to create''
You have a nil object when you didn''t expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.save
/Users/smingins/Work/depot/config/../app/controllers/
admin_controller.rb:25:in `create''
./spec/controllers/admin_controller_spec.rb:41:
Finished in 0.226535 seconds
I have been playing around with things but without any luck. The nil
error does strike me as rather odd but the test reads as I would...
2007 Nov 17
7
Down with Lambda!!
Rspec is all about using natural language to define behavior. In this
context, I feel that lambda is sorely out of place. I was chatting on
#irc and a pal of mine (wycats) proposed an interesting alternative:
alias_method :doing, :lambda
so instead of something like
lambda {post :create, {:title => nil}}.should
raise_error(ActiveRecord::RecordInvalid)
we get
doing {post :create, {:title
2007 Sep 04
16
Failure Messages in RSpec
Having used JUnit and Test::Unit, I''m quite used to having the ability to
insert a failure message, which helps when tests fail.
For instance, the example RSpec that is generated for a model class
specifies that the model class is valid. Assuming this were supposed to be
true, and it failed, I''ve now got to duplicate the code in the test in order
to find out why it
2007 Nov 18
8
helper methods starting with should
Hi all,
As an experiment in playing nice with others, we''ve added the ability
in rspec''s trunk to do this:
class ThingExamples < Spec::ExampleGroup
def should_do_stuff
...
end
end
This is how rspec 0.1 worked, and for people already comfortable with
the classes/methods approach of Test::Unit, it is a more comfortable
entry point to rspec.
For others, however, it
2006 Oct 23
10
text_field_with_auto_complete
Hi,all
I''ve used text_field_with_auto_complete for a while but still haven''t
figured out how to store the value that I selected from the suggested
options. any hints?
Thanks!
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: