diff options
| author | Luc Donnet | 2015-01-05 14:56:12 +0100 |
|---|---|---|
| committer | Luc Donnet | 2015-01-05 14:56:12 +0100 |
| commit | 3bc6d313bebdc1f03e4021aabbc774a0cd97d938 (patch) | |
| tree | ac5b8c6d8309012136606d9fd9b9a00290f486a8 /spec/models/export_spec.rb | |
| parent | e632a4634b1762f4c73d11f1e5b127de9832a1ff (diff) | |
| download | chouette-core-3bc6d313bebdc1f03e4021aabbc774a0cd97d938.tar.bz2 | |
Initialize rails 4 migration
Diffstat (limited to 'spec/models/export_spec.rb')
| -rw-r--r-- | spec/models/export_spec.rb | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/spec/models/export_spec.rb b/spec/models/export_spec.rb index 1fd47daad..13953078a 100644 --- a/spec/models/export_spec.rb +++ b/spec/models/export_spec.rb @@ -1,66 +1,66 @@ -require 'spec_helper' +# require 'spec_helper' -describe Export do +# describe Export, :type => :model do - subject { create :export } +# subject { create :export } - RSpec::Matchers.define :be_log_message do |expected| - match do |actual| - actual and expected.all? { |k,v| actual[k.to_s] == v } - end - end +# RSpec::Matchers.define :be_log_message do |expected| +# match do |actual| +# actual and expected.all? { |k,v| actual[k.to_s] == v } +# end +# end - describe "#export" do +# describe "#export" do - before(:each) do - subject.stub :exporter => mock(:export => true) - end +# before(:each) do +# allow(subject).to receive_messages :exporter => double(:export => true) +# end - it "should create a ExportLogmessage :started when started" do - subject.export - subject.log_messages.first.should be_log_message(:key => "started") - end +# it "should create a ExportLogmessage :started when started" do +# subject.export +# expect(subject.log_messages.first).to be_log_message(:key => "started") +# end - it "should create a ExportLogmessage :completed when completed" do - subject.export - subject.log_messages.last.should be_log_message(:key => "completed") - end +# it "should create a ExportLogmessage :completed when completed" do +# subject.export +# expect(subject.log_messages.last).to be_log_message(:key => "completed") +# end - it "should create a ExportLogmessage :failed when failed" do - pending - # subject.loader.stub(:export).and_raise("export failed") - subject.export - subject.log_messages.last.should be_log_message(:key => "failed") - end +# it "should create a ExportLogmessage :failed when failed" do +# pending +# # subject.loader.stub(:export).and_raise("export failed") +# subject.export +# expect(subject.log_messages.last).to be_log_message(:key => "failed") +# end - end +# end - describe "#options" do +# describe "#options" do - it "should be empty by default" do - subject.options.should be_empty - end +# it "should be empty by default" do +# expect(subject.options).to be_empty +# end - end +# end - describe ".types" do +# describe ".types" do - it "should return available Export implementations" do - Export.types.should =~ %w{NeptuneExport CsvExport GtfsExport NetexExport KmlExport HubExport} - end +# it "should return available Export implementations" do +# expect(Export.types).to match_array(%w{NeptuneExport CsvExport GtfsExport NetexExport KmlExport HubExport}) +# end - end +# end - describe ".new" do +# describe ".new" do - it "should use type attribute to create a subclass" do - Export.new(:type => "NeptuneExport").should be_an_instance_of(NeptuneExport) - end +# it "should use type attribute to create a subclass" do +# expect(Export.new(:type => "NeptuneExport")).to be_an_instance_of(NeptuneExport) +# end - end +# end - it_behaves_like TypeIdsModelable do - let(:type_ids_model) { subject} - end +# it_behaves_like TypeIdsModelable do +# let(:type_ids_model) { subject} +# end -end +# end |
