Permalink
Browse files

As usual, I misused the term 'mock' when in fact I meant 'fake' - htt…

  • Loading branch information...
1 parent cb6718d commit fada8688e8634f7465b1eb65f01299a6ad88d897 @akitaonrails committed Nov 7, 2009
Showing with 13 additions and 13 deletions.
  1. +10 −10 spec/dynamic_liquid_templates_spec.rb
  2. +2 −2 spec/{mocks.rb → fakes.rb}
  3. +1 −1 spec/spec_helper.rb
@@ -3,7 +3,7 @@
describe DynamicLiquidTemplates do
describe "simple page resource with default layout" do
it "should return the composed index action template" do
- @controller = KontrollerMock.new("pages", "index")
+ @controller = FakeController.new("pages", "index")
@controller.set(:pages, pages_collection)
output = @controller.render_with_dynamic_liquid
@@ -24,7 +24,7 @@
describe "simple post resource" do
it "should return the composed index action template" do
- @controller = KontrollerMock.new("posts", "index")
+ @controller = FakeController.new("posts", "index")
@controller.set(:posts, posts_collection)
output = @controller.render_with_dynamic_liquid
@@ -41,7 +41,7 @@
end
it "should return the composed show action template" do
- @controller = KontrollerMock.new("posts", "show")
+ @controller = FakeController.new("posts", "show")
@controller.set(:post, post_object)
output = @controller.render_with_dynamic_liquid
@@ -53,7 +53,7 @@
end
it "should return the composed edit action template" do
- @controller = KontrollerMock.new("posts", "edit")
+ @controller = FakeController.new("posts", "edit")
@controller.set(:post, post_object)
output = @controller.render_with_dynamic_liquid
@@ -66,7 +66,7 @@
end
it "should return the composed new action template" do
- @controller = KontrollerMock.new("posts", "new")
+ @controller = FakeController.new("posts", "new")
@controller.set(:post, post_object)
output = @controller.render_with_dynamic_liquid
@@ -78,7 +78,7 @@
describe "nested post/comment resource" do
before(:each) do
- @controller = KontrollerMock.new("comments", "index")
+ @controller = FakeController.new("comments", "index")
@controller.class_eval do
def parent
post_object
@@ -132,7 +132,7 @@ def parent
describe "namespaced post resource" do
it "should return composed index action template" do
- @controller = KontrollerMock.new("posts", "index")
+ @controller = FakeController.new("posts", "index")
@controller.set(:posts, posts_collection)
output = @controller.render_with_dynamic_liquid(:namespace => "admin")
@@ -148,7 +148,7 @@ def parent
output.should include('<a href="/admin/post/new">New Post</a><')
end
it "should return composed show action template" do
- @controller = KontrollerMock.new("posts", "show")
+ @controller = FakeController.new("posts", "show")
@controller.set(:post, post_object)
output = @controller.render_with_dynamic_liquid(:namespace => "admin")
@@ -158,7 +158,7 @@ def parent
output.should include('<a href="/admin/posts">Back</a>')
end
it "should return composed edit action template" do
- @controller = KontrollerMock.new("posts", "edit")
+ @controller = FakeController.new("posts", "edit")
@controller.set(:post, post_object)
output = @controller.render_with_dynamic_liquid(:namespace => "admin")
@@ -170,7 +170,7 @@ def parent
output.should include('<a href="/admin/posts">Back</a>')
end
it "should return composed new action template" do
- @controller = KontrollerMock.new("posts", "new")
+ @controller = FakeController.new("posts", "new")
@controller.set(:post, post_object)
output = @controller.render_with_dynamic_liquid(:namespace => "admin")
@@ -1,7 +1,7 @@
class DynamicTemplate
attr_accessor :path, :body
- # mock to return static fixtures instead of hitting the database
+ # fake to return static fixtures instead of hitting the database
def self.find_by_path(path)
model = DynamicTemplate.new
# replace the admin subdir just so we don't need to duplicate the posts template
@@ -16,7 +16,7 @@ def self.find_by_path(path)
end
end
-class KontrollerMock
+class FakeController
include DynamicLiquidTemplates
attr_accessor :controller_name, :action_name, :form_authenticity_token
View
@@ -8,7 +8,7 @@
require 'ruby-debug'
require File.dirname(__FILE__) + '/../lib/dynamic_liquid_templates.rb'
require File.dirname(__FILE__) + '/../lib/database_file_system.rb'
-require File.dirname(__FILE__) + '/mocks.rb'
+require File.dirname(__FILE__) + '/fakes.rb'
Spec::Runner.configure do |config|

0 comments on commit fada868

Please sign in to comment.