Replace trace-related fixtures with factories.
The mocking and stubbing in the controller tests is unfortunate, but the models interact directly with the filesystem using the trace id so that's hard to control any other way.
This commit is contained in:
parent
f7b4793c50
commit
15689af6bf
17 changed files with 543 additions and 536 deletions
11
test/factories/tracepoints.rb
Normal file
11
test/factories/tracepoints.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
FactoryGirl.define do
|
||||
factory :tracepoint do
|
||||
trackid 1
|
||||
latitude 1 * GeoRecord::SCALE
|
||||
longitude 1 * GeoRecord::SCALE
|
||||
# tile QuadTile.tile_for_point(1,1)
|
||||
timestamp Time.now
|
||||
|
||||
trace
|
||||
end
|
||||
end
|
16
test/factories/traces.rb
Normal file
16
test/factories/traces.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
FactoryGirl.define do
|
||||
factory :trace do
|
||||
sequence(:name) { |n| "Trace #{n}.gpx" }
|
||||
sequence(:description) { |n| "This is trace #{n}" }
|
||||
|
||||
# Fixme requires User Factory
|
||||
user_id 1
|
||||
|
||||
timestamp Time.now
|
||||
inserted true
|
||||
|
||||
trait :deleted do
|
||||
visible false
|
||||
end
|
||||
end
|
||||
end
|
7
test/factories/tracetags.rb
Normal file
7
test/factories/tracetags.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
FactoryGirl.define do
|
||||
factory :tracetag do
|
||||
sequence(:tag) { |n| "Tag #{n}" }
|
||||
|
||||
trace
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue