Displaying 20 results from an estimated 7000 matches similar to: "Haml and View tests"
2007 Jul 06
3
stubbing helper methods for View specs
Hi there
I have several view specs, that include the following snippet in
their "before" block to stub the methods by acts_as_authenticated
before :each do
@u = mock_model(User)
@u.should_receive(:name).and_return("Hans Muster")
template.should_receive(:logged_in?).and_return(true)
template.should_receive(:current_user).and_return(@u)
end
this
2010 Oct 11
5
Object lost in memory/trashed?
Hi,
I''ve got a problem on which I''ve spent many hours, and I can''t get a
clue on what is happening... I hope someone here will be able to help
me.
Here is the situation : my Rails app uses acts_as_commentable and
acts_as_bookmarkable on a Diagram model. Everything''s working OK
individually: I can create a comment on a Diagram, bookmark it, and so
on.
Now,
2008 Sep 25
0
Rspec, HAML with view testing
Hi all,
Has anyone experienced the following problem testing rspec against
haml views
Attempting to run a view spec (partial)
app/view/users/_foo.html.haml
it "should render it" do
render :partial => "users/foo", :locals => template_locals
end
The following error is returned:
1)
ActionView::MissingTemplate in ''shared/_jar_layout should render
2008 Sep 24
0
Rspec, HAML, view testing
Hi all,
Has anybody experience the following problem running testing rspec
against haml views
Attempting to run a view spec
app/view/users/_foo.html.haml
it "should render it" do
render :partial => "users/foo", :locals => template_locals
end
1)
ActionView::MissingTemplate in ''shared/_jar_layout should render it''
Missing templatet
2013 Mar 07
2
Puppet Dashboard changed reports view error
Hello Puppet Users !
We encounter a problem with the dashboard on this URI : /reports/changed
The /reports works fine with ~130000 reports (up to 3 months and
auto-cleaning with rake reports:prune job)
I make a reports:prune:orphaned, juste in case, but without any success.
The most recent change on the server was the puppetmaster upgrade from
3.0.2 to 3.1.0.
Here is the dashboard error log
2010 Nov 22
0
Something wrong after upgraded to puppet-dashboard 1.04
After upgraded to puppet-dashboard 1.04, when I click links to check
information of nodes or groups , such as http://localhost:3001/nodes/22,
it return a "We''re sorry, but something went wrong." to me. Checking
the log, i got something as follows:
ActionView::TemplateError (undefined method `<=>'' for #<NodeGroup id:
5, name:"Web_Marketing">) on
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
2008 Feb 11
1
image_tag is it just plain Broken?
I''m trying
<%= link_to image_tag("#{gallery.link_to}"), gallery_path(gallery)
unless gallery.thumbnail_id == 0%>
and get the error:
ActionView::TemplateError (undefined method `image_tag'' for #<Gallery:
0xb7083be4>) on line #23 of app/views/users/index.rhtml
This is my definition of link_to
def link_to
unless self.thumbnail_id == 0
picture =
2007 Dec 01
3
Rails 2 problem with compute_public_path
I''m trying to migrate to Rails 2, but keep getting these errors all
over the place:
ActionView::TemplateError: wrong number of arguments (2 for 3)
On line #61 of users/new.rhtml
58: <% if @captcha_error -%><div class="fieldWithErrors"><
% end -%>
59: <table class="signup"><tr>
60: <td
2010 Mar 30
0
using haml in internationalisation with haml views
I''m trying to use haml in my locale files but cant get it to parse.
en.yml
---------
page:
content: "
%p
some paragraph
%p
another paragraph
"
view.html.haml
------------------- (works)
=Haml::Engine.new(t(''page.content)).render
-------------------(does not)
=t(''page.content)
is the first example the only way to do this?
or am I going about
2007 Dec 27
4
Help With partials
ok i''m having problems moving a piece of code into a partial
I have a line in a view:
<%= image_tag( createturing ) %>
moving to a partial _createturing.rhtml and changing the view to:
<div id="turing"><%= render(:partial => "createturing") %></div>
gives errors:
ActionView::TemplateError (can''t convert nil into String) on
2008 Sep 30
4
Using the response object in stories
I have this statement in the layout of my application (using haml)
- if request.env["HTTP_USER_AGENT"].include?("MSIE")
= stylesheet_link_tag ''blueprint/ie.css''
= stylesheet_link_tag ''confirm_ie.css''
The problem is that request.env["HTTP_USER_AGENT"] is nil when I go to
some page in the features I write with cucumber and webrat
2007 May 30
2
ActionView::TemplateError
Hi,
I have a strange problem that only occurs on the production server.
I''ve been banging my head for hours trying to figure it out with no
success. Below is a copy of the error from the production log.
ActionView::TemplateError (Expected /www/rails_apps/scanlan/current/
public/../config/../app/models/image.rb to define Image) on line #6 of
app/views/admin/design/_record.rhtml:
3:
2008 Jul 23
0
Link_to_remote object missing
Hello, I''m in troubles trying to use ''link_to_remote'' on Rails 2.1.
Having this page:
<h4>Editing project</h4>
<% form_for(:project, :url => project_path(@project), :html =>
{ :method => :put }) do |f| %>
<p>
Name <%= f.text_field :name %>
Date <%= calendar_date_select :project, :target_date, :time =>
2008 Jun 15
2
Create haml files with rspec_controller command?
It is a nuisance to have to rename all of your files from .erb to .haml.
Is there a quick way around this?
--
Posted via http://www.ruby-forum.com/.
2007 Nov 14
0
Should receive field_for failing
I have a spec that''s not behaving as I''m thinking it should. Here''s the
code:
http://pastie.caboo.se/117931
it''s failing with:
ActionView::TemplateError in ''customers/new should receive fields_for''
Mock ''ActionView::Base'' expected :form_for with ("address", #<Address id:
nil, address1: "123 Main St.",
2011 May 04
1
is not allowed as an instance variable name error
Hey all,
I get error like this:
ActionView::TemplateError
(`@content_for_details_view_builder__-626960428'' is not allowed as an
instance variable name) in app/views/shared/_details_view.haml:
searchlogic (2.4.27) lib/searchlogic/rails_helpers.rb:75:in
`fields_for''
searchlogic (2.4.27) lib/searchlogic/rails_helpers.rb:64:in
`form_for''
2007 Nov 06
2
Why is this view spec failing?
I can''t figure out why I am getting a failure. It renders out fine in
the browser.
<h1>New member</h1>
<%= error_messages_for :member %>
<% form_for(:member, :url => members_path) do |f| %>
<fieldset>
<legend>Member Info</legend>
<p><label for="member[first_name]">First Name:</label> <%=
2010 Aug 19
0
Camping 2.1 - ERB, Haml, 1.9, bug fixes, new website!
{}
||
||
~~~~~~~~~~~~~~~ <= _whycake
~ Camping 2.1 ~
~~~~~~~~~~~~~~~
I''m pleased to announce another release of Camping, the microframework. This
time we''ve focused on improving the 1.9 support, adding (builtin) support for
more template engines, refreshing the homepage and just general bug fixes.
gem install camping
Home:
2011 Oct 29
2
comments on HAML ?
I have been asked a couple of times at job interviews if I am
familiar with HAML or Liquid so I was wondering if maybe I should
start using them and perhaps it would make the views easier to work
with.
If I install HAML on a machine where my app is that has alot of
regular HTML in the .erb views already, will it still work with those
or do I need to convert everything to HAML ? Can I have some