Commit 173c8a8759b9297b99cb536348ae549a07e2a3b9
1 parent
d6c5308e
Exists in
master
and in
29 other branches
Fixing LocationBlock tests
(ActionItem1256)
Showing
2 changed files
with
36 additions
and
36 deletions
Show diff stats
test/unit/localization_block_test.rb
... | ... | @@ -1,36 +0,0 @@ |
1 | -require File.dirname(__FILE__) + '/../test_helper' | |
2 | - | |
3 | -class LocalizationBlockTest < Test::Unit::TestCase | |
4 | - | |
5 | - def setup | |
6 | - @profile = create_user('lele').person | |
7 | - @block = LocalizationBlock.new | |
8 | - @profile.boxes.first.blocks << @block | |
9 | - @block.save! | |
10 | - end | |
11 | - attr_reader :block, :profile | |
12 | - | |
13 | - should 'provide description' do | |
14 | - assert_not_equal Block.description, LocalizationBlock.description | |
15 | - end | |
16 | - | |
17 | - should 'display no localization map without lat' do | |
18 | - assert_tag_in_string block.content.call, :tag => 'i' | |
19 | - end | |
20 | - | |
21 | - should 'display localization map' do | |
22 | - profile.lat = 0 | |
23 | - profile.lng = 0 | |
24 | - profile.save! | |
25 | - assert_tag_in_string block.content.call, :tag => 'img' | |
26 | - end | |
27 | - | |
28 | - should 'be editable' do | |
29 | - assert LocalizationBlock.new.editable? | |
30 | - end | |
31 | - | |
32 | - should 'default title be blank by default' do | |
33 | - assert_equal '', LocalizationBlock.new.title | |
34 | - end | |
35 | - | |
36 | -end |
... | ... | @@ -0,0 +1,36 @@ |
1 | +require File.dirname(__FILE__) + '/../test_helper' | |
2 | + | |
3 | +class LocationBlockTest < Test::Unit::TestCase | |
4 | + | |
5 | + def setup | |
6 | + @profile = create_user('lele').person | |
7 | + @block = LocationBlock.new | |
8 | + @profile.boxes.first.blocks << @block | |
9 | + @block.save! | |
10 | + end | |
11 | + attr_reader :block, :profile | |
12 | + | |
13 | + should 'provide description' do | |
14 | + assert_not_equal Block.description, LocationBlock.description | |
15 | + end | |
16 | + | |
17 | + should 'display no localization map without lat' do | |
18 | + assert_tag_in_string block.content, :tag => 'i' | |
19 | + end | |
20 | + | |
21 | + should 'display localization map' do | |
22 | + profile.lat = 0 | |
23 | + profile.lng = 0 | |
24 | + profile.save! | |
25 | + assert_tag_in_string block.content, :tag => 'img' | |
26 | + end | |
27 | + | |
28 | + should 'be editable' do | |
29 | + assert LocationBlock.new.editable? | |
30 | + end | |
31 | + | |
32 | + should 'default title be blank by default' do | |
33 | + assert_equal '', LocationBlock.new.title | |
34 | + end | |
35 | + | |
36 | +end | ... | ... |