Displaying 20 results from an estimated 500 matches similar to: "Agile Rails (1st edition), depot TDD "exercise""
2006 May 06
1
depot test-driven development exercise
(I posted this yesterday but within 20 minutes my thread was hijacked
so I''m not sure anyone really saw this.)
I''ve been working my way through the Agile book and just completed
the depot sample application. I learned quite a bit along the way.
On page 171 we are led through the creation of a test (that fails)
for new code. The new code (a search function) is left as an
2006 May 06
0
RE: Rails Digest, Vol 20, Issue 156
I am looking for a ruby hosting service. Can any one recommend one for me.
-----Original Message-----
From: rails-request@lists.rubyonrails.org [mailto:rails-request@lists.rubyonrails.org]
Sent: Saturday, May 06, 2006 7:37 AM
To: rails@lists.rubyonrails.org
Subject: Rails Digest, Vol 20, Issue 156
Send Rails mailing list submissions to
rails@lists.rubyonrails.org
To subscribe or
2005 Dec 23
6
Agile book - test error
Hi all,
I get an error when testing the "store_controller_test.rb"
The troublesome line is in the test below:
def test_add_to_cart
get :add_to_cart, :id => @version_control_book.id <<<
cart = session[:cart]
assert_equal @version_control_book.price, cart.total_price
assert_redirected_to :action => ''display_cart''
follow_redirect
2005 Dec 18
1
assert_template fails?
Hi All,
I have a seemingly simple problem - but can''t figure out the problem. I
have a simple functional test like so:
def test_should_show_search_dropdown
get :index
assert_response :success
assert_template :search
end
Inspite of having search.rhtml in /app/views/layout, it fails with an error:
1) Error:
test_should_show_search_dropdown(SearchControllerTest):
2006 Jul 27
2
(Agile Rails 2nd ED) Depot App: Iteration B1 500 Error
Hello:
I am working through the 2nd Edition of the agile book (after watching the
first edition age on my shelf for 6 months), and am having a problem with
the newly created ''store''
I''ve checked the files and fucntions that I''ve written, namely:
model/product find_products_for_sale
controller/store index
views/store/index.rhtml
and they all seem to have
2006 Feb 21
0
Blog of building Agile Web Development w/Rails Depot App using Ackbar/KirbyBase (Chapter 6-7)
Sorry for the long Subject line, but I couldn''t figure out what else to
call it. :-)
Just a quick announcement to tell you that I have worked through
Chapters 6 and 7 so far of "Agile Web Development with Rails", using
Ackbar/KirbyBase to develop the Depot app instead of MySQL. You can
find my blog about it at:
http://houseonfire.wordpress.com
For those who
2006 Feb 26
0
NoMethodError in Agile Web Devleopment Depot Tutorial
I''m working on building the shopping cart in the Depot tutorial in the
Agile Web Development book. I''m at the part (about page 80) where you
build the ability to add items to the cart. I''m able to get to
/store/display_cart/ and it seems items are being added, but if I just
click on a link to add an item (/store/add_to_cart/2) it gives me this:
NoMethodError in
2006 Jan 05
0
Help with the Agile Depot application tutorial
anyone can explain me why in the Agile Depot Tutorial application they
use i.product_id
to find if a product already exist in the cart, because the cart
contains items, each of them references a product.
I tried i.product_id like in the tutorial
and
i.product.i
all of these 2 notation works , but i find the second seems more
clean??? isn''t it.
Any explanation will be fine
Regards
2006 Jan 08
0
Agile book depot question
I have been working on implementing a variant of the depot example as a
method of learning rails. I have come up against a css question that is
driving me nuts. This may not be the right forum to ask this question. If
anyone would like to refer me to another place to ask, I would be grateful.
Most of the code that I am working on is straight from the examples, with
minor alterations. What is
2006 May 13
0
integration: assert_template() always fails...
Hi Coders :-)
Maybe somebody can help...
My integration tests always fail when using assert_template()
class ShopTest < ActionController::IntegrationTest
def test_very_simple
get("/shop/index")
assert_success
assert_template("/shop/index")
end
end
the "/shop/index" is a valid url which renders flawlessly in the browser. however, the test
2006 Jan 05
2
Agile Depot Tutorial Help
anyone can explain me why in the Agile Depot Tutorial application they
use i.product_id
to find if a product already exist in the cart, because the cart
contains items, each of them references a product.
I tried i.product_id like in the tutorial
and
i.product.i
all of these 2 notation works , but i find the second seems more
clean??? isn''t it.
Any explanation will be fine
Regards
2007 Feb 06
2
Testing RJS actions
Hi all !
This is my test:
def test_destroy_xhr
Article.expects(:find).with("1").returns(@article = mock("article"))
@article.expects(:destroy).returns(true)
delete :destroy, :id => 1, :format => :js
assert_template "destroy.rjs"
end
And my implementation:
def destroy
@article.destroy
respond_to do |format|
format.html {
2006 Apr 25
2
agile depot app login failure :(
Hi *,
In an attempt to go back to the drawing board and learn RoR some more -
I have built the depot application from the agile book.
After finishing I tried to create a user for the admin section, however
when ever I go to:
http://localhost:3000/login/add_user
It redirects to the login action, I don''t see the [add user] submit
button??
I am sure this is connected to the
2007 Feb 07
1
The Depot "Add to Cart" sessions question (2.ed agile book)
Hello,
Im in the process of working my way through the 2.ed of the agile book.
As many of you already know, the book goes through the regular
development cycle of the Depot application. I have hit a wall
when they started talking about the sessions and the exact mechanics of
how an item is added to the session.
The code looks like this:
depot/app/controllers/store_controller:
def add_to_cart
2006 Feb 05
8
Agile Rails book: depot problem
I recently finished the first part of the "Agile Rails" book. But, the
depot doesn''t completely work as it should. I still have 2 problems:
I will explain them in 2 threads.
The first one is:
I can''t destroy products (I can only creat and update them). When I try
to delete a product --> http://localhost:3001/admin/destroy/3
I get this error message:
2005 Dec 30
1
Problems with Testing (Depot) demo app in Agile Rails book
I''ve encountered a perplexing problem whilst following along the demo
app in the "Agile Web Development with Rails" book. Any help would be
greatly appreciated. Here is a brief time line of my tale of woe:-
0. Been programming (business apps) and designing/building DBs for two
decades - but new to both Ruby and Rails (so I apologise in advance if
I''ve made some
2006 Feb 05
8
Agile Rails book: depot problem 2
My second problem is:
Listing users, and deleting them doesn''t work.
If I try to list user, i just get this list:
User Delete
User Delete
User Delete
User Delete
I''m using this code in the login_controller:
def list_users
@all_users = User.find(:all)
end
def delete_user
@id = params[:id]
if id && user = User.find(id)
begin
User.destroy
2005 Sep 22
5
Adding Categories to the Depot example in the Agile Rails book
Hi ya, I want to add categories to the depot example in the Agile rails
book.
These are my thoughts:
Create a new table called categories with id, title, description, and
image fields.
Add a new field to the products table called category_id
Create a model called Category with "has_many :products"
Now I should have a one to many link between the products and categories
tables?
Now
2006 Jul 17
5
Functional Tests misbehaving with Globalize
Howdy all
Apologies to the folks subscribed to the globalize list for dual
posting this message...
I''ve got a project running globalize and rails 1.1.4, and I''ve only
recently adopted a strong love for testing. Now my models are 100%
tested (I must note that I do not make use of any translations in the
database yet), and I''ve now started with functional tests before
2006 Sep 26
0
some help with functional testing of nested routes
I have the following functional test in test/functional for testing my
products_controller:
require File.dirname(__FILE__) + ''/../test_helper''
require ''products_controller''
# Re-raise errors caught by the controller.
class ProductsController
def rescue_action(e)
raise e
end
end
class ProductsControllerTest < Test::Unit::TestCase
fixtures