diff options
Diffstat (limited to 'spec/models/import_spec.rb')
| -rw-r--r-- | spec/models/import_spec.rb | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/spec/models/import_spec.rb b/spec/models/import_spec.rb deleted file mode 100644 index bbf6725d7..000000000 --- a/spec/models/import_spec.rb +++ /dev/null @@ -1,61 +0,0 @@ -require 'spec_helper' - -describe Import do - - subject { create :import } - - 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 "#import" do - - before(:each) do - subject.stub :loader => mock(:import => true) - end - - it "should create a ImportLogmessage :started when started" do - subject.import - subject.log_messages.first.should be_log_message(:key => "started") - end - - it "should create a ImportLogmessage :completed when completed" do - subject.import - subject.log_messages.last.should be_log_message(:key => "completed") - end - - it "should create a ImportLogmessage :failed when failed" do - subject.loader.stub(:import).and_raise("import failed") - subject.import - subject.log_messages.last.should be_log_message(:key => "failed") - end - - end - - describe "#options" do - - it "should be nil by default" do - subject.options.should be_nil - end - - end - - describe ".types" do - - it "should return available Import implementations" do - Import.types.should =~ %w{NeptuneImport CsvImport GtfsImport NetexImport} - end - - end - - describe ".new" do - - it "should use type attribute to create a subclass" do - Import.new(:type => "NeptuneImport").should be_an_instance_of(NeptuneImport) - end - - end - -end |
