1
0
Fork 0
mirror of https://github.com/drapergem/draper synced 2023-03-27 23:21:17 -04:00
draper/features/step_definitions/route_steps.rb
2012-10-24 07:24:03 -04:00

20 lines
740 B
Ruby

Given /^a post exists$/ do
@post = Post.create
@decorator = PostDecorator.decorate(@post)
end
Then /^a _path helper with the underlying model works$/ do
@decorator.path_helper_with_model.should == {:post_path => "/posts/#{@post.id}"}
end
Then /^a _path helper with the underlying model's id works$/ do
@decorator.path_helper_with_model_id.should == {:post_path => "/posts/#{@post.id}"}
end
Then /^a _url helper with the underlying model works$/ do
@decorator.url_helper_with_model.should == {:post_url => "http://www.example.com/posts/#{@post.id}"}
end
Then /^a _url helper with the underlying model's id works$/ do
@decorator.url_helper_with_model_id.should == {:post_url => "http://www.example.com/posts/#{@post.id}"}
end