Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleanup custom column spec.

  • Loading branch information...
commit b86cfba3f57ba923d8cb858ef384ac9db04e956d 1 parent 214798f
@bobbytables authored
Showing with 10 additions and 8 deletions.
  1. +10 −8 spec/lib/base_spec.rb
View
18 spec/lib/base_spec.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.