similar to: What to test for views?

Displaying 20 results from an estimated 9000 matches similar to: "What to test for views?"

2007 Nov 01
5
Can''t delete app/helpers
I would like to remove some unused helpers from the app/helpers dir, but when I do so my specs fail. Why is this? I don''t see where those helpers are referenced within the tests. Is there a way to delete these unused files? Thanks -- Posted via http://www.ruby-forum.com/.
2007 Oct 05
13
spec''ing view render partial collection, local variable not found
I''m trying to spec out a render partial collection but I get the following error 2) NoMethodError in ''/games/_game.rhtml should show game name'' undefined method `body'' for #<#<Class:0x316580c>:0x2f1154c> /Volumes/EXTERNAL/web/omenking.ca/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/have_text.rb:12:in `matches?''
2007 Oct 01
15
how to spec views
I''m trying to spec a view but haven''t done much view specing. This view render different partials depending on authentication of the user: annon, admin, player So I I''ll write if conditionals in the view with the partials it "should render signup propaganda for annon users trying to view games" do render "/games/index.rhtml"
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
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> <%=
2007 Nov 20
5
Autotest rspec issues
I''m having trouble getting autotest to run "out of the box" with rspec. I''ve got a Leopard setup with Zentest 3.5.0, rspec on trunk, and rails 2.0PR. No ".autotest" file. There are a couple of issues: 1. Running ''autotest'' inititally yields a command not found for "spec --diff unified etc etc". This seems to be an old issue but
2007 Aug 08
3
rspec with autotest on a windows machine
Hello all, I''m new to rSpec but after reading a couple of tutorials I''ve become enamored. Anyway, I am at minute 42 of the rSpec basics screencast ( peepcode.com) and I''m having the following error running autotest w/rSpec: D:\ruby\projects\forecaster>autotest loading autotest/rails_rspec c:\ruby\bin\ruby -rrubygems -e "require ''redgreen''"
2007 Oct 10
2
RSpec seems to be having a hard time loading Helper classes
I am getting the error when I run the command: rake spec This is a new project with not current test written besides the ones auto-created for me. +++++++++ $ rake spec (in /Users/chrisolsen/Projects/Rails/chrisolsen/trunk) /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:266:in `load_missing_constant'': uninitialized constant ProjectsHelper
2006 Mar 06
4
Are views inheritable
Is it possible to use a child model''s controller to impliment it''s parents view before adding its own output ? possibly by the use of super ? _tony -- Posted via http://www.ruby-forum.com/.
2007 Mar 27
18
Textile Editor Plugin v0.1
The Textile Editor Helper (TEH) is a Javascript-based text formatting toolbar that will be added to all of your text areas that utilize the TEH feature. TEH was developed to provide a more WYSIWYG-ish option for users of our Rails CMS called slate while still letting us use Textile. ====================== = So what are the features? ====================== These are a list of the current features
2006 Aug 02
3
controller methods for app/views/A/B.rhtml
If I want to call A/B, can I call a corresponding controller action for it? Like with app/views/A.rhtml, I can it will call the method A in the controller file. But with A/B.rhtml, I cant do def A/B. -- Posted via http://www.ruby-forum.com/.
2006 Jul 22
3
How to use variables in your layout views?
Let''s say I wanted to find 3 products from my database and put them in the layouts/application.rhtml view. Where do I find these 3 products? Do I just do it in application.rhtml? <% for product in Product.find(:all, :limit => 3) %> Because I was under the impression that you really don''t want to do this in your views. You should do this in your controllers and
2006 Apr 27
2
problematic admin/views
ok, i have a pretty almost finished (frontend) blog, i have defined an admin zone with authentication to add content, now im getting trouble with the views for the controllers in the admin zone, here you can see my file structure: http://img284.imageshack.us/my.php?image=tmpviews6oq.gif and my admin controllers like this: controllers/admin/admin_controller.rb class Admin::AdminController
2006 Aug 03
1
storing views in subdirectories?
I''d like to organize my project structure by storing certain related views into a subdirectory. For example, I have a bunch of interviews which each contain their own view (the client doesn''t want them content managed, or put in the database). Right now I have them placed inside "app/views/site/interview_one.rhtml", "app/views/site/interview_two.rhtml", etc.
2006 Apr 10
8
Advice on Similar Views with Helpers
I have some embedded tables that form different sections of a view. I find that I use the same look for certain ones which means I have to duplicate the same exact table for each section that''s similar. Is there a way to do.. hmm.. well.. kind of like what a layout does using @content_for_layout, but for a partial. Does that make any sense whatsoever? :) OK so here''s some
2005 Jul 06
2
Composite Views
Hello: How do you create a composite view? I have a form based on the model "contacts" which consists the following models: - organization - person - address I was going to use partials to create the form; e.g: - organizations/_form.rhtml - people/_form.rhtml .etc ...and render them with the appropriate tag: <%= render_partial ''people/form'', @person %> I
2003 Jan 02
2
--copy-unsafe-links, links preserved in source tree or local directory?
Hi, I'm a bit confused about what the '--copy-unsafe-links' option considers the 'source tree'. In the man page it says that for links pointing outside the 'source tree' the file will be copied, but when I try this, for all links pointing outside of the local directory the files are copied even though the links point to files that are in the directory tree that is
2007 Nov 23
4
How to pin down location of views/shared directory ?
My app has a header & footer I want common to each section. They live in app/views/shared/_header.rhtml & _footer.rhtml. They are referenced by app/views/layouts/application.rhtml as one would expect: <div id="header"> <%= render :partial => ''shared/header'' %> </div> They contain many lines like this: <a
2007 Nov 07
10
Plain Text Story example
Hey all, Does anyone have an example(s) of the plain text story runner for rails? I have read David''s blog (http://blog.davidchelimsky.net/articles/2007/10/22/plain-text-stories-on-rails) about it but I would like to see some examples with all of the step matchers included... I couldn''t find any more examples on google talking about the plain text stories and the example
2007 Oct 06
4
spec''ing views, mock_model associations
I writing a spec that returns the count of how many players in a game: it "should how many players in a link to all players" do render :partial =>"games/game", :object => @game response.should have_tag(''a'',"(2) Players") end I''m not sure how to do the mock model, I think it would be done two ways but unsure of the syntax: 1: add