Skip to content

Commit

Permalink
fixed to evaluate description text at correct level
Browse files Browse the repository at this point in the history
  • Loading branch information
Russell Norris committed Jan 21, 2009
1 parent 506d410 commit b93a1e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/lucky_sneaks/view_spec_helpers.rb
Expand Up @@ -559,13 +559,14 @@ def it_should_not_render_partial(name)
# This is equivalent to setting <tt>@the_template = "users/index.haml.erb"</tt>
# in a before block.
def use_describe_for_template!
if File.exists?(File.join(RAILS_ROOT, "app/views", self_description_text))
template = self_description_text
if File.exists?(File.join(RAILS_ROOT, "app/views", template))
before(:each) do
@the_template = self_description_text
@the_template = template
end
else
error_message = "You called use_describe_for_template! "
error_message << "but 'app/views/#{self_description_text}' does not exist. "
error_message << "but 'app/views/#{template}' does not exist. "
raise NameError, error_message
end
end
Expand Down

0 comments on commit b93a1e4

Please sign in to comment.