Displaying 20 results from an estimated 10000 matches similar to: "Should I Test My Fixtures?"
2007 Dec 13
10
Version naming to use in a RoR proyect
Hi everyone,
I would need to know if RoR follow any policy for version naming; I
mean, something like linux´s kernel does or similar.
For instance, kernel uses numbers separated in groups by dots (i.e.
pre 2.6 - AA.BB.CC). These groups mean differents fixtures, bugs
fixed...
I will start a big proyect from scratch with rails and I want to
choose now a standart to use and avoid future problems
2007 Feb 26
2
undefined method ... from `alias_method'
0 wicked var/www % ./script/console
Loading development environment.
>> r = Recipe.find :first
NameError: undefined method `recipe_type='' for class `Recipe''
from ./script/../config/../config/../app/models/recipe.rb:
101:in `alias_method''
In recipes_controller:
alias_method :orig_recipe_type=, :recipe_type=
def recipe_type=(t)
if t.nil?
2008 Jan 21
7
undefined method error
Hello everyone,
I am following the Practical Rails: Social Networking
sites book. In chapter 7 photo gallery I am getting a
NoMethodError in Pages#show
Showing layouts/_menu.rhtml where line #12 raised:
undefined method `new_entry_path'' for #<ActionView::Base:0x52fa56c>
Extracted source (around line #12):
9: <% if is_logged_in? %>
10:
2007 Dec 10
10
Reading Hash/Array
Hi all,
My app is generating a form with several bill_items that should be
updated (fields to be updated are description and net).
The text_field_tag names are bill_item[update][#{id}][description] and
bill_item[update][#{id}][net] (and I added bill_item[update][#{id}]
[id] just in case)
The param received is:
{"commit"=>"Save",
2008 May 26
5
Noob SASS error (permission denied)
I just created the sass directory in my stylesheets directory and
when
I reload my page I get this error:
Status: 500 Internal Server Error
Permission denied - /Users/Justin/kicksite/trunk/public/
stylesheets/
application.css
/usr/local/lib/ruby/gems/1.8/gems/haml-2.0.0/lib/sass/plugin.rb:
72:in `initialize''
/usr/local/lib/ruby/gems/1.8/gems/haml-2.0.0/lib/sass/plugin.rb:
72:in
2005 Dec 14
3
Plugin w/ Migrations and/or Fixtures?
I''m working on a plugin which needs to add both schema and data to the app
database, and I''m trying to figure out the best way to do it. I''d like to use a
db migration to modify the schema and load the data from a YAML fixture, but
Rails doesn''t seem to support migrations for plugins. To do so, the schema_info
table would need to change to include a
2007 Dec 11
4
Lost in translation - Rails 2.0 Nested Resources, Custom Actions
The shift to the :has_many and :has_one options when defining nested
resource routes has me perplexed. The block format allows me to define
custom REST actions like publish in the example below:
map.resources :users do |user|
user.resources :articles, :member => { :publish => :put }
end
It also allows for multiple levels of nesting if necessary.
What I''d really like to
2008 Jan 23
1
acts_as_state_machine doesn't error on invalid state transition?
While using acts_as_state_machine, I noticed it doesn''t error when invalid
state transition is used. No false return, no exception. By invalid state
transition, I mean utilizing an event that does not define the current state
as a ''from'' state. Does anyone find this lacking? I would like to be able
to catch invalid state transition (such as attempting to fulfill a
2006 Mar 19
2
Unit test confusion
Hey all,
I''m following along with AWDWR, specifically the unit testing.
On page 148, it shows you how Test::Unit::TestCase will automatically
define instance variables based on your fixtures.
It doesn''t seem to actually work, though. It seems that both @artists
["beatles"]["name"] and @beatles.name are nil objects in my test,
where as
2007 Jan 24
2
hello! first post + context_setup
Greetings all.
I''m looking over a ''greenfield'' pasture, and enjoying the TDD(BDD)
process of creation.
I''m currently rspec''ing a finite state machine
(acts_as_state_machine). As such, I need to persist the model through
''specifies'' within the context - from top to bottom.
I have bumped into a couple of probs:
1. context_setup
2007 Apr 17
3
using rake db:fixtures:load with rspec fixtures
Hi, I''m new to rspec. I have some fixtures in /spec/fixtures. If they
were in /test/fixtures they could be loaded with rake db:fixtures:load.
Is there any way other than a symlink to load my rspec fixtures into
the database with rake? Or, can I cause rspec to load the fixtures
from /test/fixtures?
Thanks,
Paul
2007 May 12
3
[OT] - In Memory Databases
My specs are still taking to long to run in a rails app. Is anyone
using an in-memory database to run their specs? Any pointers or tips?
Scott
2007 Apr 25
9
Running specs for a plugin - undefined method ''define'' for object
I''m trying to write specs for a plugin I''m developing named audit_fu, and
I''m running into a problem which I can''t get past it. I''ve got the same
specs setup in the main rails app, and everything works fine there, it''s
just running the plugin specs that I''m having a problem with. My setup is:
- edge rails
- edge rspec (in
2011 Aug 10
1
How to stop Rspec loading my Cucumber fixtures
I have a bunch of fixtures designed to populate the database for my Cucumber
integration tests.
But at this stage I want my database to be empty when using Rspec.
So, I moved the fixtures from `/spec/fixtures` to
`features/support/fixtures`, and updated `features/support/env.rb` to read:
Fixtures.reset_cache
fixtures_folder = File.join(RAILS_ROOT, ''features'',
2006 May 09
2
load fixtures
I''m finally getting beyond using basic test fixtures, and a few questions
have popped up. Has anyone found ways to do these?
1. Use a test fixture that is named differently from its table name? We''d like
to have more than one possible fixture per table. (Or perhaps use test fixtures
named similarly but in different directories.)
2. Load a test fixture for one test method only
2008 Jul 17
5
.build method
I have gone to the api and have searched the internet and looked
through the books that I have, but I am having trouble finding an
explanation on what the .build method actually does and how it is
used.
I guess the best example is if I want to create a todo list
application where I can create a new todo list and add to do items all
at the same time.
I would post to the todolist controller to
2006 Aug 03
2
Including ALL fixtures for a test
I am running into some issues with my functional tests because they need
info from almost every single table in the database. I have long
laundry lists of fixture names to include on these test files and then I
have to troubleshooot bizarre test failures because of a fixture that
was not included.
So is there a way to simply include all fixtures in a test? Something
like:
fixtures :all
2007 Aug 08
1
Transactional fixtures not working as expected
Hi!
I am quite new to BDD and I just wrote my first tests. Suddenly I
received unexpected results because in a model test I load only
users-fixtures but when the views-fixtures in which I load the
posts-fixtures, are run before this model-test, the posts-fixtures are
loaded too. I test for example if there is one record in the posts-table
after creating one post. But when there are fixtures
2005 Mar 03
4
Loading data with fixtures
Can anyone point me to an easy way to load fixture
data into the development (not test) database?
- Tim
__________________________________
Celebrate Yahoo!''s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/
2005 Jul 06
3
populating development database from test fixtures
Hi,
Is it possible to populate the development database from the test
fixtures? I''m trying to keep the development database schema in a
plain-text sql file and modifying that when I need to modify the
database structure. However, then I have to either manually
repopulate the database or add in additional sql statements that
populate the test database.
It seems like it would be useful