Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove available spec in columns. Add specs for human name.

  • Loading branch information...
commit 28fed6c01039d823268a305d4ea4e489a70a26b2 1 parent 522f839
@bobbytables authored
Showing with 9 additions and 14 deletions.
  1. +9 −14 spec/lib/column_spec.rb
View
23 spec/lib/column_spec.rb
@@ -20,22 +20,17 @@
it 'returns the email from a proc correctly' do
email_column.value(dummy_model, view_context).should == 'robert at example.com'
end
+ end
- context '.available?' do
- it 'returns true on successful constraint' do
- table = Class.new(DummyTable).new([dummy_model], view_context)
- column = TableCloth::Column.new(:name, if: :admin?)
- column.available?(table).should be_true
- end
-
- it 'returns false on failed constraints' do
- table = Class.new(DummyTable).new([dummy_model], view_context)
- table.stub admin?: false
-
+ context "human name" do
+ it "returns the label when set" do
+ column = FactoryGirl.build(:column, options: { label: "Whatever" })
+ expect(column.human_name).to eq("Whatever")
+ end
- column = TableCloth::Column.new(:name, if: :admin?)
- column.available?(table).should be_false
- end
+ it "humanizes the symbol if no label is set" do
+ column = FactoryGirl.build(:column, name: :email)
+ expect(column.human_name).to eq("Email")
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.