spec/models/massive/file_spec.rb in massive-0.1.0 vs spec/models/massive/file_spec.rb in massive-0.1.1
- old
+ new
@@ -204,6 +204,28 @@
file.gather_info!
file.reload.sample_data.should eq([row.fields, row.fields, row.fields])
end
end
end
+
+ describe "#has_info?" do
+ context "when file already has gathered info" do
+ before do
+ file.encoding = 'utf-8'
+ file.col_sep = '|'
+ file.total_count = 3000
+ end
+
+ its(:has_info?) { should be_true }
+ end
+
+ context "when file has not gathered info" do
+ before do
+ file.encoding = nil
+ file.col_sep = nil
+ file.total_count = nil
+ end
+
+ its(:has_info?) { should be_false }
+ end
+ end
end