Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a couple of unit tests for project transfers.

  • Loading branch information...
commit 257c197c8c65f1c65fcdbbedf4167ce3a2581c07 1 parent 36591ee
@gravitystorm authored
Showing with 25 additions and 0 deletions.
  1. +25 −0 spec/models/project_spec.rb
View
25 spec/models/project_spec.rb
@@ -32,4 +32,29 @@
subject.should_not be_valid
end
end
+
+ describe "transfer" do
+ let(:way) { FactoryGirl.create(:way_with_nodes) }
+ let(:relation) { FactoryGirl.create(:relation_with_members) }
+ let(:project) { FactoryGirl.create(:project) }
+
+ it "should work for ways" do
+ way.should be_valid
+ project.ways.should be_empty
+ project.transfer
+
+ project.ways.should_not be_empty
+ project.ways.first.nodes.length.should eq(way.nodes.length)
+ end
+
+ it "should work for relations" do
+ relation.should be_valid
+ relation.relation_members.length.should_not be_zero
+ project.relations.should be_empty
+ project.transfer
+
+ project.relations.should_not be_empty
+ project.relations.first.relation_members.length.should_not be_zero
+ end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.