Skip to content

Commit

Permalink
Started to modify the specs for the new behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-gomez committed Jan 3, 2012
1 parent 236ef8c commit b999fd8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -4,4 +4,4 @@ test.*
doc/*
pkg/*
tmp/*

.idea/
11 changes: 9 additions & 2 deletions test/classic_mapping_test.rb
Expand Up @@ -3,7 +3,6 @@
require 'rubygems'
require 'test/unit'
require 'rack/test'
require 'date'

require 'test/fixtures/classic_application'

Expand All @@ -19,7 +18,8 @@ def setup
:archive_path => "/test/blog/archive/articles",
:about_path => "/test/blog/about",
:search_path => "/test/blog/find-articles",
:drafts_path => "/test/blog/unpublished"
:drafts_path => "/test/blog/unpublished",
:profile_path => "/test/blog/5"
}
@root_paths = @link_paths.inject({}) do |hash, (name, path)|
hash[name] = "#{path}/"
Expand Down Expand Up @@ -109,5 +109,12 @@ def test_should_check_path_method_with_array_params
assert_equal body_link, response.body.split("\n")[1]
end
end

def test_should_return_ok_on_variable_path
get app.profile_path(:user_id => 5) do |response|
assert response.ok?
puts response.body
end
end
end

9 changes: 8 additions & 1 deletion test/fixtures/classic_application.rb
Expand Up @@ -16,7 +16,8 @@ def env
mapping :posts => "articles", # posts_path => /blog/articles
:archive => "archive/articles", # archive_path => /blog/archive/articles
:search => "find-articles", # search_path => /blog/find-articles
:drafts => "unpublished" # drafts_path => /blog/unpublished
:drafts => "unpublished", # drafts_path => /blog/unpublished
:profile => "users/:user_id" # profile_path => /user/:user_id

before do
@date = Date.today
Expand Down Expand Up @@ -60,3 +61,9 @@ def env
#{link_to "Unpublished", :drafts, :posts, :title => 'Unpublished'}
end_content
end

get profile_path do |user_id|
<<-end_content.gsub(/^ /,'')
"Im user number #{user_id}"
end_content
end
1 change: 0 additions & 1 deletion test/modular_mapping_test.rb
Expand Up @@ -3,7 +3,6 @@
require 'rubygems'
require 'test/unit'
require 'rack/test'
require 'date'

require 'test/fixtures/modular_application'

Expand Down

0 comments on commit b999fd8

Please sign in to comment.