Displaying 20 results from an estimated 5000 matches similar to: "view specs with partials"
2006 Nov 30
4
response is null when using should_render_rjs
I''m trying to use rspec to test a controller that has ajax.
I have the following action:
def change_ad_type_form
render :update do |page|
page.replace_html ''ad_sub_form'', :partial => ''text''
end
end
and the following spec:
specify "should return Text subform on AJAX request to
change_ad_type_form" do
2007 Feb 07
3
odd mock behavior
I''m seeing some odd behavior around the should_receive() when given a
block combined with some cardinality.
For example, with the following...
my_mock.should_receive(:foo).twice do |i|
puts i
end
... the spec passes but i never gets puts''ed.
With the following...
my_mock.should_receive(:foo) do |i|
puts i
end
... i gets puts''ed twice but the spec fails because
2006 Oct 23
6
overriding mock expectations
There is one annoyance I''m encountering with the Mock API in rSpec.
Overall it works well, as far as dynamic mocks go ;)... but there''s
this one thing... It doesn''t allow overriding of expectations.
example:
m = mock("blah")
m.should_receive(:one).any_number_of_times().and_return(1)
m.should_receive(:one).and_return(1)
The second call to should_receive
2006 Oct 27
2
and_return broken when using arrays
m = mock("blah")
m.should_receive(:foo).and_return([1, 2, 3])
When foo() is called on the mock it returns the first elements of the
array, 1. Shouldn''t it return the whole array?
Micah Martin
8th Light, Inc.
www.8thlight.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Oct 04
3
spec task prints usage
A small feature request.
When running the spec rake task, if any of the folders ''spec/models'',
''spec/controller'', or ''spec/views'' doesn''t exist or if they don''t
contain any specs, the spec usage is printed.
In my case I didn''t have a views directory. I was able to get rid of
the usage output by creating the
2006 Oct 24
2
1 should be 2. huh?
There''s another quirk I wanted to bring up. It''s about the failure
message with should_equal and should_be.
x.should_equal 2
a.should_not_be nil
When they fail they yield messages like:
1 should equal 2
nil should not be nil
When I''m caught off guard, which can be often, these messages confuse
me. 1 should equal 2? No it shouldn''t. nil should not be
2006 Oct 25
2
mock parameter problem
Here''s another one.
spec:
m = mock("blah")
m.should_receive(:foo).with(1)
code:
m.foo(2)
Failure message:
Mock ''blah'' expected ''foo'' once, but received it 0 times
------
Twice now I''ve gotten this failure message and wasted time trying to
understand why the method foo() was not being called despite all
evidence suggesting
2007 May 07
6
mock frameworks
Just curious - now that rspec (as of 0.9) let''s you choose your mock
framework, how many of you are actually using (or planning to use)
mocha or flexmock?
Anybody planning to use any other mock framework besides rspec, mocha
or flexmock?
Thanks,
David
2006 Sep 13
2
stale spec runner?
I''ve been working with the RSpec on Rails plugin. Great job guys!
The Rails spec runner (server) definitely speeds things up nicely.
But I''m having some trouble keeping it functional. When I start the
server, the first spec execution runs fine. Every following
execution fails though. Each spec complains about the
''controller_path'' missing from my
2006 Oct 04
1
String.should_hav_tag
I''ve just upgraded to rspec 0.6.4 and several specs were broken. All
for the same reason. String.should_have_tag doesn''t seem to be
supported any longer.
It used to be possible to write assertions like:
response.body.should_have_tag :tag => "form"
or
"<html><body/></html>".should_have_tag :tag => "body"
But these fail
2008 Mar 31
10
Problems with *_path() and *_url() helpers when using Publisher
Hello,
I am running into issues using *_path() and *_url() helpers the
Facebooker Publisher framework. I encounter the following error when
using these helpers while *inside of a partial*:
undefined method `default_url_options'' for ActionView::Base:Class
I''ve seen a few other people speak about this issue, yet I haven''t
seen any resolution on the mailing list yet.
2007 Aug 02
2
Do the :attributes and :content matchers work
[Rails plugin 1.0.5]
Hi,
I am looking for some guidance.
When working on a partial which looks like this
<div class="bug" style="width: 100%;" />
I have some examples which should fail - I think - but do not:
it '' should fail'' do
response.should have_tag( ''div.bug'', :content => ''There is no
2007 Mar 17
10
a WARNING about cruise task or user-specified build task for Rails
If (like me) you use ccrb to test a Rails app
and (like me) you define your own :cruise task, because, for
example, you use rspec rather than Test::Unit
and (like me) you have the RAILS_ENV ||= ''production'' line in
environment.rb (because, like me, you use crummy shared hosting)
Your build will run in production mode, possibly screwing up your
production database,
2006 Mar 27
15
Go Go Gadget - A Rails ecommerce site released today
I''ve just completed my first Ruby on Rails project, an online store for
electronic gadgets including digital cameras, MP3 players and PDAs.
It''s for Australian shoppers only, but everyone can take a look and
browse through!
http://www.gogogadget.com.au
All feedback, comments, etc are welcome.
Cheers,
Dan
2005 May 19
5
[OT] Sqlite2 question
So, under Sqlite2, if I want to update a database''s schema, I have to
dump the DB, modify the table''s structure, then go and modify EVERY
insert statement.
The insert statements look like (from memory):
INSERT INTO my_table VALUES (''some_id'', ''some_val'', '''', '''', '''',
''some_other
2005 Dec 15
6
Navigation menu
I have a navigation menu that contains a link per controller in my
application.
This menu is the same for all controllers, but I want this behaviour:
<a>Users</a>
<span>Statistics</span>
and
<span>Users</span>
<a>Statistics</a>
depending on the page you''re currently on.
I''ve put a <render :partial =>
2006 Jul 22
4
Accessing the controller name in your views?
I need to know what controller and action the user is currently in
to do various things in my layouts/application.rhtml file. Isn''t
there is a better way than:
<% if params[:controller] == "whatever" && params[:action] ==
"whatever" %>some html<% end %>
I know in the controllers you can just use controller_name, but that
is not provided
2007 Oct 23
9
Running rails specs outside of the normal project tree
I want to create a spec/regressions directory with various
regressions (for my rails project). I tried the following:
describe LoginController, "regression for user creation when
steves_sister does not exist", :behavior_type => :controller do
controller_name :login
before :each do
@params = {
"commit"=>"Create Account",
2012 Jul 07
2
[LLVMdev] Exception handling slowdown?
On Jul 6, 2012, at 3:48 PM, Bill Wendling wrote:
> On Jul 5, 2012, at 1:33 AM, Duncan Sands wrote:
>> Hi Bill,
>>
>>> Nothing that I'm aware of has changed with EH. Is it possible to bisect the problem?
>>
>> I don't see any relevant LLVM changes, so I guess clang C++ compilation slowed
>> down due to some clang changes. I'm not going to
2008 Jan 04
2
Menu - labels
Webgen uses file paths to generate multilevel menues, bread crumbs etc. And
limits the character range in paths to a-zA-Z. As the directory names are
used verbatim as menu labels this is fairly limitting for non-english pages.
Is there a way to map directory names to configurable UTF8 strings for menu
labels?
oao