@@ -30,16 +30,41 @@ class GttTileSourcesControllerTest < ActionController::TestCase
30
30
31
31
test 'should create tile source' do
32
32
assert_difference 'GttTileSource.count' do
33
- post :create , params : { tile_source : {
34
- name : 'test' ,
35
- type : 'GttOsmTileSource' ,
36
- options_string : {
37
- attributions : 'test' ,
38
- url : 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png'
39
- } . to_json
40
- } }
33
+ post :create , params : {
34
+ tile_source : {
35
+ name : 'test' ,
36
+ type : 'GttOsmTileSource' ,
37
+ options_string : {
38
+ attributions : 'test' ,
39
+ url : 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png'
40
+ } . to_json
41
+ }
42
+ }
41
43
end
42
44
45
+ assert_redirected_to '/gtt_tile_sources'
46
+ assert ts = GttTileSource . last
47
+ assert_equal 'test' , ts . options [ 'attributions' ]
48
+ assert_equal 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png' ,
49
+ ts . options [ 'url' ]
50
+ end
51
+
52
+ test 'should create tile source and continue' do
53
+ assert_difference 'GttTileSource.count' do
54
+ post :create , params : {
55
+ tile_source : {
56
+ name : 'test' ,
57
+ type : 'GttOsmTileSource' ,
58
+ options_string : {
59
+ attributions : 'test' ,
60
+ url : 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png'
61
+ } . to_json
62
+ } ,
63
+ continue : 'Create and continue'
64
+ }
65
+ end
66
+
67
+ assert_redirected_to '/gtt_tile_sources/new'
43
68
assert ts = GttTileSource . last
44
69
assert_equal 'test' , ts . options [ 'attributions' ]
45
70
assert_equal 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png' ,
0 commit comments