Permalink
Browse files

matchers specs was in wrong files

  • Loading branch information...
novroy authored and dchelimsky committed Mar 30, 2010
1 parent 01098b7 commit 0a23f701b3f1d7f43812b8eea9dcd7219044a6cb
@@ -1,8 +1,39 @@
require "spec_helper"
describe "render_template" do
it "delegates to assert_template" do
self.should_receive(:assert_template).with({:this => "hash"}, "this message")
"response".should render_template({:this => "hash"}, "this message")
describe "be_a_new matcher" do
context "new record" do
let(:record) do
Class.new do
def new_record?; true; end
end.new
end
context "right class" do
it "passes" do
record.should be_a_new(record.class)
end
end
context "wrong class" do
it "fails" do
record.should_not be_a_new(String)
end
end
end
context "existing record" do
let(:record) do
Class.new do
def new_record?; false; end
end.new
end
context "right class" do
it "fails" do
record.should_not be_a_new(record.class)
end
end
context "wrong class" do
it "fails" do
record.should_not be_a_new(String)
end
end
end
end
@@ -1,39 +1,8 @@
require "spec_helper"
describe "be_a_new matcher" do
context "new record" do
let(:record) do
Class.new do
def new_record?; true; end
end.new
end
context "right class" do
it "passes" do
record.should be_a_new(record.class)
end
end
context "wrong class" do
it "fails" do
record.should_not be_a_new(String)
end
end
end
context "existing record" do
let(:record) do
Class.new do
def new_record?; false; end
end.new
end
context "right class" do
it "fails" do
record.should_not be_a_new(record.class)
end
end
context "wrong class" do
it "fails" do
record.should_not be_a_new(String)
end
end
describe "redirect_to" do
it "delegates to assert_redirected_to" do
self.should_receive(:assert_redirected_to).with("destination")
"response".should redirect_to("destination")
end
end
@@ -1,8 +1,8 @@
require "spec_helper"
describe "redirect_to" do
it "delegates to assert_redirected_to" do
self.should_receive(:assert_redirected_to).with("destination")
"response".should redirect_to("destination")
describe "render_template" do
it "delegates to assert_template" do
self.should_receive(:assert_template).with({:this => "hash"}, "this message")
"response".should render_template({:this => "hash"}, "this message")
end
end

0 comments on commit 0a23f70

Please sign in to comment.