Update importer_spec for system user

This commit is contained in:
Neil Lalonde 2013-09-06 16:51:30 -04:00
parent a9f3489237
commit 10547848f0
1 changed files with 2 additions and 5 deletions

View File

@ -170,13 +170,11 @@ describe Jobs::Importer do
end end
# Neil, please have a look here # Neil, please have a look here
pending "should have a users table that's empty" do it "should have a users table that's empty" do
@user1 = Fabricate(:user) @user1 = Fabricate(:user)
# community user needs to be accounted for
User.count.should == 2
Jobs::Importer.any_instance.stubs(:ordered_models_for_import).returns([User]) Jobs::Importer.any_instance.stubs(:ordered_models_for_import).returns([User])
Jobs::Importer.new.execute(@importer_args) Jobs::Importer.new.execute(@importer_args)
User.count.should == 1 User.count.should == 0 # empty table (data loading is stubbed for this test)
end end
it "should indicate that an import is running" do it "should indicate that an import is running" do
@ -192,7 +190,6 @@ describe Jobs::Importer do
Discourse.expects(:enable_maintenance_mode).in_sequence(seq).at_least_once Discourse.expects(:enable_maintenance_mode).in_sequence(seq).at_least_once
Jobs::Importer.any_instance.expects(:backup_tables).in_sequence(seq).at_least_once Jobs::Importer.any_instance.expects(:backup_tables).in_sequence(seq).at_least_once
Jobs::Importer.any_instance.expects(:load_data).in_sequence(seq).at_least_once Jobs::Importer.any_instance.expects(:load_data).in_sequence(seq).at_least_once
# fails here
Jobs::Importer.new.execute( @importer_args ) Jobs::Importer.new.execute( @importer_args )
end end