Permalink
Browse files

Cleanup custom column spec.

  • Loading branch information...
1 parent 214798f commit b86cfba3f57ba923d8cb858ef384ac9db04e956d @bobbytables committed Dec 14, 2012
Showing with 10 additions and 8 deletions.
  1. +10 −8 spec/lib/base_spec.rb
View
@@ -71,17 +71,19 @@
end
end
- it '.column can take a custom column' do
- email_column = Class.new(TableCloth::Column) do
- def value(object, view)
- "AN EMAIL!"
+ context "custom" do
+ let(:custom_column) do
+ Class.new(TableCloth::Column) do
+ def value(object, view)
+ "AN EMAIL!"
+ end
end
end
- subject.column :email, using: email_column
- subject.new([dummy_model], view_context)
-
- subject.columns[:email].value(dummy_model, view_context).should == "AN EMAIL!"
+ it '.column can take a custom column' do
+ subject.column :email, using: custom_column
+ subject.columns[:email].value(dummy_model, view_context).should == "AN EMAIL!"
+ end
end
end

0 comments on commit b86cfba

Please sign in to comment.