Navigation Menu

Skip to content

Commit

Permalink
ルーティングのテスト(1)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuroda committed Mar 31, 2012
1 parent c5d906b commit f4bed18
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions spec/controllers/products_controller_spec.rb
@@ -0,0 +1,21 @@
# coding: utf-8

require 'spec_helper'

describe ProductsController do
let(:department) { FactoryGirl.create(:department, started_on: Date.new(1999, 1, 1)) }
let(:product) { FactoryGirl.create(:product,
department_code: department.code, started_on: Date.new(1999, 1, 1)) }

before do
DurationLimited.current_date = Date.new(2000, 1, 1)
end

describe "department_product_path" do
it "ハッシュでURLパスを作る" do
department_product_path(current_date: "2000-01-01",
department_id: product.department.code, id: product.code).
should == "/2000-01-01/departments/#{product.department.code}/products/#{product.code}"
end
end
end

0 comments on commit f4bed18

Please sign in to comment.