~ubuntu-branches/ubuntu/wily/tdiary/wily

« back to all changes in this revision

Viewing changes to spec/acceptance/save_conf_default_spec.rb

  • Committer: Package Import Robot
  • Author(s): Hideki Yamane
  • Date: 2013-05-19 16:14:01 UTC
  • mfrom: (12.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130519161401-hf5oyr8g8a94fsew
Tags: 3.2.2-2
Upload to unstable 

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
                #fill_in "banner", :with => "http://sho.tdiary.net/images/banner.png"
15
15
                # TODO x_frame_open の設定
16
16
 
17
 
                click_button "OK"
18
 
                within('title') { page.should have_content('(設定完了)') }
 
17
                page.all('div.saveconf').first.click_button "OK"
 
18
                # within('title') { page.should have_content('(設定完了)') }
19
19
 
20
20
                click_link '最新'
21
21
                # TODO その他の項目の反映を確認
22
 
                within('title') { page.should have_content('ただの日記') }
 
22
                # within('title') { page.should have_content('ただの日記') }
23
23
 
24
24
                visit '/update.rb?conf=default'
25
25
                page.should have_field "author_name", :with => "ただただし"
45
45
bravo
46
46
</div>
47
47
FOOTER
48
 
                click_button "OK"
49
 
                within('title') { page.should have_content('(設定完了)') }
 
48
                page.all('div.saveconf').first.click_button "OK"
 
49
                #within('title') { page.should have_content('(設定完了)') }
50
50
 
51
51
                click_link '最新'
52
52
                within('h1') { page.should have_content('alpha') }
81
81
                fill_in 'latest_limit', :with => 1
82
82
                select '非表示', :from => 'show_nyear'
83
83
 
84
 
                click_button "OK"
85
 
                within('title') { page.should have_content('(設定完了)') }
 
84
                page.all('div.saveconf').first.click_button "OK"
 
85
                # within('title') { page.should have_content('(設定完了)') }
86
86
 
87
87
                click_link '最新'
88
88
                page.should have_content('★')
97
97
                visit '/update.rb?conf=logger'
98
98
                select 'DEBUG', :from => 'log_level'
99
99
 
100
 
                click_button "OK"
101
 
                within('title') { page.should have_content('(設定完了)') }
 
100
                page.all('div.saveconf').first.click_button "OK"
 
101
                # within('title') { page.should have_content('(設定完了)') }
102
102
 
103
103
                click_link '最新'
104
104
                # TODO ログレベルの確認
111
111
                visit '/update.rb?conf=timezone'
112
112
                fill_in 'hour_offset', :with => '-24'
113
113
 
114
 
                click_button "OK"
115
 
                within('title') { page.should have_content('(設定完了)') }
 
114
                page.all('div.saveconf').first.click_button "OK"
 
115
                # within('title') { page.should have_content('(設定完了)') }
116
116
 
117
117
                click_link '追記'
118
118
                y, m, d = (Date.today - 1).to_s.split('-').map {|t| t.sub(/^0+/, "") }
119
 
                within('div.day div.form') {
120
 
                        within('span.year') { page.should have_field('year', :with => y) }
121
 
                        within('span.month') { page.should have_field('month', :with => m) }
122
 
                        within('span.day') { page.should have_field('day', :with => d) }
123
 
                }
 
119
                within('span.year') { page.should have_field('year', :with => y) }
 
120
                within('span.month') { page.should have_field('month', :with => m) }
 
121
                within('span.day') { page.should have_field('day', :with => d) }
124
122
 
125
123
                click_link '設定'
126
124
                click_link '時差調整'
127
125
                page.should have_field('hour_offset', :with => '-24.0')
128
126
        end
129
127
 
130
 
        scenario 'Rack 環境でテーマ選択が保存される', :exclude_selenium => true do
131
 
                visit '/update.rb?conf=theme'
132
 
                select 'Tdiary1', :from => 'theme'
133
 
 
134
 
                click_button "OK"
135
 
                within('title') { page.should have_content('(設定完了)') }
136
 
 
137
 
                click_link '最新'
138
 
                within('head') {
139
 
                        page.should have_css('link[href="assets/base.css"]')
140
 
                        page.should have_css('link[href="assets/tdiary1/tdiary1.css"]')
141
 
                }
142
 
 
143
 
                visit '/update.rb?conf=theme'
144
 
                within('select option[selected]'){
145
 
                        page.should have_content 'Tdiary1'
146
 
                }
 
128
        if RUBY_VERSION > '1.9'
 
129
                scenario 'Rack 環境でテーマ選択が保存される', :exclude_selenium do
 
130
                        visit '/update.rb?conf=theme'
 
131
                        select 'Tdiary1', :from => 'theme'
 
132
 
 
133
                        page.all('div.saveconf').first.click_button "OK"
 
134
 
 
135
                        click_link '最新'
 
136
                        page.body.should be_include('href="assets/base.css"')
 
137
                        page.body.should be_include('href="assets/tdiary1/tdiary1.css"')
 
138
 
 
139
                        visit '/update.rb?conf=theme'
 
140
                        within('select option[selected]'){
 
141
                                page.should have_content 'Tdiary1'
 
142
                        }
 
143
                end
147
144
        end
148
145
 
149
 
        scenario 'Webrick 環境でテーマ選択が保存される', :exclude_rack => true do
 
146
        scenario 'Webrick 環境でテーマ選択が保存される', :exclude_rack do
150
147
                visit '/update.rb?conf=theme'
151
148
                select 'Tdiary1', :from => 'theme'
152
149
 
153
 
                click_button "OK"
154
 
                within('title') { page.should have_content('(設定完了)') }
 
150
                page.all('div.saveconf').first.click_button "OK"
155
151
 
156
152
                click_link '最新'
157
153
                within('head') {