Displaying 20 results from an estimated 1000 matches similar to: "Render template not matching absolute path"
2007 Jun 27
2
Controller specs not shareable?
Hi
I just wondered if there was a reason why Rails controller specs are
not shareable? eg
describe "All XHR POSTs to /gap/calculate_quote", :shared => true do
controller_name :gap
# ...
end
describe "XHR POST /gap/calculate_quote with valid details" do
it_should_behave_like "All XHR POSTs to /gap/calculate_quote"
# ...
end
blows up with
2007 Apr 20
1
getting controller specs to work on edge
I''m using edge spec, edge rspec_on_rails, edge rails. I just switched to
edge and ran the translator tool and I''m trying to get everything to pass
again. One of my issues is getting render back up and working for my
controller specs, here''s an example:
describe "Requesting /users using GET" do
controller_name :users
setup do
@user = mock_model(User)
2007 Jun 12
3
rspec 1.0.x and liquid?
Is anyone else using liquid with the > 1 rspec? This seems to fail:
it ''should render show'' do
response.should render_template(''buyers/show'')
get :show, :id => 1
end
with an error like
1)
NoMethodError in ''/buyer GET should render show''
You have a nil object when you didn''t expect it!
The error occurred
2007 Jun 15
2
Is it still possible to use should_have_rjs
Hi
I''ve come back to a Rails project after about a month doing other
work, and there''s a lot of changes. I was on the 0.7 branch before
and I''ve upgraded to RSpec 1.0.5. I used the spec translator, fixed
the cases where it barfed on unusual line contents, and all my model
and controller specs now pass. But I''m getting 53 failures on my view
specs,
2005 Oct 18
1
Rcss - first public release
Hi All!
My first contribution to Ruby/Rails community is ready. Here is short
snippet from README as an overview:
Rcss implements CSS-SSC (Server-side Constants) in Ruby.
Main features:
* Create rich CSS files using:
- ERB templates
- Server-side constants
- Server-side classes (preliminary)
* Simply add Rcss files to any Rails application
* Process Rcss files off-line using command
2006 Jan 22
2
Using register_template_handler to serve CSS files (Making ActionView handle .css as .rhtml)
Hi,
I wanted to be able to use some Rails code inside CSS files, so I set up
a controller (StylesController) to serve CSS files that reside inside
the controller''s view folder when the browser requests /stylesheets/:action
So in the controller I just define empty actions with the names I want
my style sheets in (ie: def cooleffects end - that would respond to
2006 Mar 23
5
Dirt simple .rcss templates
There was some discussion on this list recently about doing .rcss
templates in Rails using a custom template handler. I''ve come up
with a very simple way to support rcss without a handler. Turns out
all it takes is a route and an action that calls render(:file...). I
put a full write-up on my blog earlier today:
2006 Mar 03
17
RCSS problems
Hi List!
Following http://rcss.rubyforge.org/files/README.html, I''m trying to get
RCSS to work with Rails. The rcss command itself works fine, but when
trying to access http://localhost:3000/rcss/test.css I always get
"Unknown action - No action responded to test.css", which I don''t
understand since the route and controller are in place.
Anyway, hopefully this is
2006 Apr 13
2
Content-type on render :file
Hi all,
I''ve just been trying out the dirt-simple rcss scheme posted here:
http://blog.hasmanythrough.com/articles/2006/03/23/dirt-simple-rcss-templates
It looks like the content-type declaration on the line:
render :file => file_name, :content_type => ''text/css''
isn''t getting honoured. I had to add a separate:
2007 May 01
2
Problem validating boolean
Hi
I''ve got a problem validating a boolean and I can''t see what the
problem is. Here''s my model:
class FinanceAgreement < ActiveRecord::Base
belongs_to :asset
validates_presence_of :finance_company
validates_inclusion_of :balance, :in => 0.01..10_000_000
validates_inclusion_of :term, :in => 1..600
validates_numericality_of
2006 Aug 03
1
Using instance variables in CSS
What suggestions do you guys have for using instance variables in CSS?
I suppose I could just include a partial with style tags, but I''m
looking for something a little more elegant.
I found this: http://rcss.rubyforge.org/ Has anyone used it?
--
Posted via http://www.ruby-forum.com/.
2007 Oct 08
6
spec''in controllers request for nested routes
describe PlayersController, "handling GET /saltmines/games/1/players" do
before do
@game = mock_model(Game, :to_param => "1")
@game.stub_association!(:players, :find => mock_model(Player))
end
def do_get
get :index, :game_id => @game
end
it "should be successful" do
do_get
response.should be_success
end
it "should
2010 Jan 09
1
errors when installing packages (ubuntu)
Hi List,
I'm having problems installing certain packages. When I try to install
fields, I get the output below. I have highlighted the what I perceive as
the first error (spam seems to be a dependency of fields). Can I assume this
is causing dependency problems for fields, which fails to install at the
end, or is there a deeper problem? I run Ubuntu Karmic Koala on R 2.9.2.
2>
2007 Jun 02
7
I''m really bad at controllers, help please.
Hey,
Sorry for so many questions - I''m really bad at this right now.
I''m trying to cover the following code w/ rspec
def index
if params[:user_id]
@user = User.find(params[:user_id])
@messages = @user.messages
end
end
So basically what I''m doing is listing all the messages for a user,
provided there is an id parameter.
describe
2007 Oct 26
3
Specing with Subdomains as Account Keys
How do you go about implementing and rspecing subdomains as account
keys? I''m sure that this must be an issues for others as well.
So I have an app using subdomains as account keys. The Application
Controller sets up @current_company in a before filter. Everything is
done within the context of the @current_company.
After reading about Demeter''s Revenge
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 Jun 07
2
When to send "post" and "get" in blocks.
Hi,
I''m new to RSpec. I have a question about how to write controller specs.
Here''s a code generated by scaffolding (with Rspec).
def do_get
get :index
end
it "should be successful" do
do_get
response.should be_success
end
it "should render index template" do
do_get
response.should
2007 Oct 11
2
Login testing ideas
I''ve been going through Pat''s example story and noticed that there was
no checking for a bad login. I assume this is because that would have
made the article bigger and more complicated than it needed to be.
So the question that comes of of this is:
How do folks normally handle the negative case? My plan was to just
use another scenario, but as a new person to BDD/TDD,
2008 Apr 15
0
How to cache dynamic CSS (RCSS)?
Hi,
I''m using this tutorial: http://blog.hasmanythrough.com/2006/3/23/dirt-simple-rcss-templates
to make dynamic CSS files. However I can''t figure out how expire
cached CSS files.
Here''s my code: http://pastie.caboo.se/181021. Most of it is copied
from the tutorial.
Files are cached properly - i.e.
<%= stylesheet_link_tag "main" %> generates
2007 Apr 17
1
controller.should render_action ?
Hi
Is there a render_action matcher to go with render_template? I can''t
see any mention of one in the docs. Do you have to still do it old-
school?
Thanks
Ashley