RubyApp 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -3
- data/Gemfile.lock +1 -1
- data/features/default.feature +2 -2
- data/features/elements/button.feature +9 -0
- data/features/{dialog.feature → elements/dialog.feature} +19 -13
- data/features/elements/input.feature +20 -0
- data/features/elements/link.feature +9 -0
- data/features/elements/list.feature +19 -0
- data/features/elements/markdown.feature +9 -0
- data/features/elements/page.feature +10 -0
- data/features/elements/pages/exception_page.feature +10 -0
- data/features/step_definitions/default_macros.rb +1 -1
- data/features/step_definitions/default_steps.rb +7 -3
- data/features/support/env.rb +1 -1
- data/lib/ruby_app/application.rb +16 -41
- data/lib/ruby_app/configuration.rb +9 -17
- data/lib/ruby_app/element.rb +27 -23
- data/lib/ruby_app/elements/base/base_page.js.haml +1 -1
- data/lib/ruby_app/elements/base/base_page.rb +5 -5
- data/lib/ruby_app/elements/list.js.haml +1 -1
- data/lib/ruby_app/elements/list.rb +5 -5
- data/lib/ruby_app/elements/lists/select.js.haml +1 -1
- data/lib/ruby_app/elements/lists/select.rb +1 -3
- data/lib/ruby_app/elements/markdown.js.haml +1 -1
- data/lib/ruby_app/elements/markdown.rb +5 -5
- data/lib/ruby_app/elements/navigation/base/base_breadcrumbs.js.haml +1 -1
- data/lib/ruby_app/elements/navigation/base/base_breadcrumbs.rb +3 -3
- data/lib/ruby_app/elements/navigation/page_link.js.haml +1 -1
- data/lib/ruby_app/elements/navigation/page_link.rb +3 -3
- data/lib/ruby_app/elements/navigation/page_menu.js.haml +1 -1
- data/lib/ruby_app/elements/navigation/page_menu.rb +3 -3
- data/lib/ruby_app/elements/pages/authentication/open_id/authentication_page.rb +2 -2
- data/lib/ruby_app/elements/pages/authentication/open_id/ax_authentication_page.rb +2 -2
- data/lib/ruby_app/elements/pages/authentication/open_id/google_authentication_page.rb +1 -1
- data/lib/ruby_app/elements/pages/authentication/open_id/my_open_id_authentication_page.rb +1 -1
- data/lib/ruby_app/elements/pages/authentication/open_id/yahoo_authentication_page.rb +1 -1
- data/lib/ruby_app/elements/pages/default_page.rb +1 -1
- data/lib/ruby_app/elements/pages/exception_page.html.haml +0 -2
- data/lib/ruby_app/elements/pages/settings_page.rb +2 -2
- data/lib/ruby_app/elements/pages/test_pages/button_test_page.css.haml +3 -0
- data/lib/ruby_app/elements/pages/test_pages/button_test_page.html.haml +7 -0
- data/lib/ruby_app/elements/pages/test_pages/button_test_page.js.haml +3 -0
- data/lib/ruby_app/elements/pages/test_pages/button_test_page.rb +39 -0
- data/lib/ruby_app/elements/pages/test_pages/default_test_page.rb +8 -15
- data/lib/ruby_app/elements/pages/test_pages/dialog_test_page.rb +1 -1
- data/lib/ruby_app/elements/pages/test_pages/exception_test_page.html.haml +5 -0
- data/lib/ruby_app/elements/pages/test_pages/exception_test_page.rb +33 -0
- data/lib/ruby_app/elements/pages/test_pages/input_test_page.css.haml +1 -0
- data/lib/ruby_app/elements/pages/test_pages/input_test_page.html.haml +3 -0
- data/lib/ruby_app/elements/pages/test_pages/input_test_page.js.haml +1 -0
- data/lib/ruby_app/elements/pages/test_pages/input_test_page.rb +2 -0
- data/lib/ruby_app/elements/pages/test_pages/link_test_page.css.haml +3 -0
- data/lib/ruby_app/elements/pages/test_pages/link_test_page.html.haml +7 -0
- data/lib/ruby_app/elements/pages/test_pages/link_test_page.js.haml +3 -0
- data/lib/ruby_app/elements/pages/test_pages/link_test_page.rb +39 -0
- data/lib/ruby_app/elements/pages/test_pages/linked_test_page.css.haml +2 -0
- data/lib/ruby_app/elements/pages/test_pages/linked_test_page.html.haml +5 -0
- data/lib/ruby_app/elements/pages/test_pages/linked_test_page.js.haml +2 -0
- data/lib/ruby_app/elements/pages/test_pages/linked_test_page.rb +30 -0
- data/lib/ruby_app/elements/pages/test_pages/list_test_page.css.haml +1 -0
- data/lib/ruby_app/elements/pages/test_pages/list_test_page.html.haml +2 -1
- data/lib/ruby_app/elements/pages/test_pages/list_test_page.js.haml +1 -0
- data/lib/ruby_app/elements/pages/test_pages/list_test_page.rb +16 -11
- data/lib/ruby_app/elements/pages/test_pages/markdown_test_page.css.haml +2 -0
- data/lib/ruby_app/elements/pages/test_pages/markdown_test_page.html.haml +5 -0
- data/lib/ruby_app/elements/pages/test_pages/markdown_test_page.js.haml +2 -0
- data/lib/ruby_app/elements/pages/test_pages/markdown_test_page.rb +38 -0
- data/lib/ruby_app/elements/pages/test_pages/select_test_page.rb +44 -0
- data/lib/ruby_app/elements/pages/test_pages/test_page.html.haml +14 -0
- data/lib/ruby_app/elements/pages/test_pages/test_page.rb +42 -0
- data/lib/ruby_app/language.rb +9 -12
- data/lib/ruby_app/log.rb +19 -9
- data/lib/ruby_app/mixins/{configuration.rb → configure_mixin.rb} +2 -2
- data/lib/ruby_app/mixins/{delegate.rb → delegate_mixin.rb} +1 -1
- data/lib/ruby_app/mixins/{hash.rb → hash_mixin.rb} +5 -1
- data/lib/ruby_app/mixins/{render.rb → render_mixin.rb} +2 -2
- data/lib/ruby_app/mixins/{route.rb → route_mixin.rb} +5 -5
- data/lib/ruby_app/mixins/{template.rb → template_mixin.rb} +11 -11
- data/lib/ruby_app/mixins/{translate.rb → translate_mixin.rb} +1 -1
- data/lib/ruby_app/rack/application.rb +3 -3
- data/lib/ruby_app/rack/route.rb +14 -30
- data/lib/ruby_app/request.rb +36 -13
- data/lib/ruby_app/session.rb +17 -23
- data/lib/ruby_app/translations/en.yml +77 -15
- data/lib/ruby_app/version.rb +1 -1
- data/rakefile +1 -12
- data/spec/application_spec.rb +25 -0
- data/spec/configuration_spec.rb +25 -0
- data/spec/element_spec.rb +54 -5
- data/spec/elements/navigation/breadcrumbs_spec.rb +17 -25
- data/spec/elements/page_spec.rb +2 -13
- data/spec/language_spec.rb +25 -0
- data/spec/log_spec.rb +25 -0
- data/spec/mixins/configure_mixin_spec.rb +24 -0
- data/spec/mixins/delegate_mixin_spec.rb +28 -0
- data/spec/mixins/hash_mixin_spec.rb +39 -0
- data/spec/mixins/render_mixin_spec.rb +127 -0
- data/spec/mixins/route_mixin_spec.rb +60 -0
- data/spec/mixins/{template_spec.rb → template_mixin_spec.rb} +3 -3
- data/spec/mixins/test_a.css.haml +4 -3
- data/spec/mixins/test_a.html.haml +0 -1
- data/spec/mixins/test_a.js.haml +4 -3
- data/spec/mixins/test_b.css.haml +4 -4
- data/spec/mixins/test_b.js.haml +2 -2
- data/spec/mixins/test_c.css.haml +4 -4
- data/spec/mixins/test_c.js.haml +2 -2
- data/spec/mixins/translate_mixin_spec.rb +25 -0
- data/spec/request_spec.rb +25 -0
- data/spec/session_spec.rb +39 -0
- data/spec/spec_helper.rb +7 -0
- data/spec/support/shared.rb +19 -5
- metadata +75 -38
- data/features/breadcrumbs.feature +0 -11
- data/features/content.feature +0 -16
- data/features/exception.feature +0 -53
- data/features/input.feature +0 -13
- data/features/list.feature +0 -12
- data/features/month.feature +0 -14
- data/spec/mixins/render_spec.rb +0 -191
- data/spec/mixins/route_spec.rb +0 -60
- data/spec/mixins/test_e.html.haml +0 -2
- data/spec/mixins/test_f.html.haml +0 -2
- data/spec/mixins/test_g.css.haml +0 -4
@@ -34,40 +34,59 @@ ruby_app:
|
|
34
34
|
title: Test Pages
|
35
35
|
content:
|
36
36
|
body: |
|
37
|
-
[`
|
37
|
+
[`ButtonTestPage`](RubyApp::Elements::Pages::TestPages::ButtonTestPage) ... A page with a single, clickable button
|
38
38
|
|
39
|
-
[`
|
39
|
+
[`DialogTestPage`](RubyApp::Elements::Pages::TestPages::DialogTestPage) ... A page with links to show a variety of dialogs (e.g. busy dialog, exception dialog, message dialog, month dialog, etc.)
|
40
40
|
|
41
|
-
[`
|
41
|
+
[`ExceptionTestPage`](RubyApp::Elements::Pages::TestPages::ExceptionTestPage) ... A page that raises an exception when rendered
|
42
42
|
|
43
|
-
[`
|
43
|
+
[`InputTestPage`](RubyApp::Elements::Pages::TestPages::InputTestPage) ... A page with a variety of input controls (e.g. simple input, duration input, etc.)
|
44
44
|
|
45
|
-
[`
|
45
|
+
[`LinkTestPage`](RubyApp::Elements::Pages::TestPages::LinkTestPage) ... A page with a single, clickable link
|
46
46
|
|
47
|
-
[`
|
47
|
+
[`ListTestPage`](RubyApp::Elements::Pages::TestPages::ListTestPage) ... A page with a variety of lists (e.g. simple list, select list, etc.)
|
48
|
+
|
49
|
+
[`MarkdownTestPage`](RubyApp::Elements::Pages::TestPages::MarkdownTestPage) ... A page with markdown containing a single, clickable link
|
50
|
+
|
51
|
+
[`TestPage`](RubyApp::Elements::Pages::TestPages::TestPage) ... A test page showing load, release, and trigger events.
|
52
|
+
|
53
|
+
---
|
54
|
+
|
55
|
+
[`GoogleAuthenticationPage`](RubyApp::Elements::Pages::Authentication::OpenID::GoogleAuthenticationPage) ... re/authenticate using Google
|
56
|
+
|
57
|
+
[`MyOpenIDAuthenticationPage`](RubyApp::Elements::Pages::Authentication::OpenID::MyOpenIDAuthenticationPage) ... re/authenticate using myOpenID
|
58
|
+
|
59
|
+
[`YahooAuthenticationPage`](RubyApp::Elements::Pages::Authentication::OpenID::YahooAuthenticationPage) ... re/authenticate using Yahoo!
|
48
60
|
|
49
61
|
busy_dialog:
|
50
62
|
message: Retrieving authentication information ...
|
63
|
+
button_test_page:
|
64
|
+
title: Button Test Page
|
65
|
+
content:
|
66
|
+
body: |
|
67
|
+
Click the button below to go to another page.
|
68
|
+
button:
|
69
|
+
body: Click
|
51
70
|
dialog_test_page:
|
52
71
|
title: Dialog Test Page
|
53
72
|
content:
|
54
73
|
body: |
|
55
|
-
[`BusyDialog`](do_busy_dialog) ...
|
74
|
+
[`BusyDialog`](do_busy_dialog) ... Show and then hide a 'busy' dialog for 30 seconds.
|
56
75
|
|
57
|
-
[`ConfirmationDialog`](do_confirmation_dialog) ...
|
76
|
+
[`ConfirmationDialog`](do_confirmation_dialog) ... Ask for confirmation.
|
58
77
|
|
59
|
-
[`ExceptionDialog`](do_exception_dialog) ...
|
78
|
+
[`ExceptionDialog`](do_exception_dialog) ... Raise an exception and show the `class` and `message` properties.
|
60
79
|
|
61
|
-
[`MessageDialog`](do_message_dialog) ...
|
80
|
+
[`MessageDialog`](do_message_dialog) ... Show a sample message dialog.
|
62
81
|
|
63
|
-
[`MonthDialog`](do_month_dialog) ...
|
82
|
+
[`MonthDialog`](do_month_dialog) ... Show a calendar month dialog, hide it when a date is clicked, and then show the clicked date (the last date clicked was <span id='last_value'>(nothing)</span>).
|
64
83
|
busy_dialog:
|
65
84
|
message: Busy dialog ...
|
66
85
|
confirmation_dialog:
|
67
86
|
title: Confirmation Dialog
|
68
87
|
message: Are you sure?
|
69
88
|
message_dialog:
|
70
|
-
title: You
|
89
|
+
title: You clicked ...
|
71
90
|
message: %1
|
72
91
|
exception: Exception dialog
|
73
92
|
message_dialog:
|
@@ -77,10 +96,19 @@ ruby_app:
|
|
77
96
|
month_dialog:
|
78
97
|
title: Month Dialog
|
79
98
|
message_dialog:
|
80
|
-
title: You
|
99
|
+
title: You clicked ...
|
81
100
|
message: %1
|
101
|
+
exception_test_page:
|
102
|
+
title: Exception Test Page
|
103
|
+
content:
|
104
|
+
body: |
|
105
|
+
Rendering this page raises an exception.
|
106
|
+
exception: Exception page
|
82
107
|
input_test_page:
|
83
108
|
title: Input Test Page
|
109
|
+
content:
|
110
|
+
body: |
|
111
|
+
Enter a value in the input fields below. When changed a dialog will show the entered value.
|
84
112
|
label:
|
85
113
|
input: Input
|
86
114
|
duration_input: DurationInput
|
@@ -88,17 +116,51 @@ ruby_app:
|
|
88
116
|
message:
|
89
117
|
title: Input Test
|
90
118
|
message: You input '%1'.
|
119
|
+
link_test_page:
|
120
|
+
title: Link Test Page
|
121
|
+
content:
|
122
|
+
body: |
|
123
|
+
Click the link below to go to another page.
|
124
|
+
link:
|
125
|
+
body: Click
|
126
|
+
linked_test_page:
|
127
|
+
title: Linked Test Page
|
128
|
+
content:
|
129
|
+
body: |
|
130
|
+
This is the other page.
|
91
131
|
list_test_page:
|
92
132
|
title: List Test Page
|
133
|
+
content:
|
134
|
+
body: |
|
135
|
+
Click an item below.
|
93
136
|
message_dialog:
|
94
137
|
message:
|
95
138
|
title: List Test
|
96
|
-
message: You
|
139
|
+
message: You clicked '%1'.
|
140
|
+
markdown_test_page:
|
141
|
+
title: Markdown Test Page
|
142
|
+
content:
|
143
|
+
body: |
|
144
|
+
Click [here](go) to go to another page.
|
145
|
+
link:
|
146
|
+
body: Click
|
147
|
+
test_page:
|
148
|
+
title: Test Page
|
149
|
+
content:
|
150
|
+
body: |
|
151
|
+
The list below will populate as the page is rendered (immediate), loaded (once fully loaded in the browser), triggered (once 2 seconds have elapsed), and unloaded (once another page is loaded).
|
152
|
+
rendered: Rendered
|
153
|
+
loaded: Loaded
|
154
|
+
triggered: Triggered
|
155
|
+
unloaded: Unloaded
|
156
|
+
not_loaded: (not loaded)
|
157
|
+
not_triggered: (not triggered)
|
158
|
+
not_unloaded: (not unloaded)
|
97
159
|
default_page:
|
98
160
|
title: Home
|
99
161
|
content:
|
100
162
|
body: |
|
101
|
-
|
163
|
+
Click [here](go_test) to go to the test pages.
|
102
164
|
authentication:
|
103
165
|
open_id:
|
104
166
|
authentication_page:
|
data/lib/ruby_app/version.rb
CHANGED
data/rakefile
CHANGED
@@ -21,22 +21,11 @@ namespace :ruby_app do
|
|
21
21
|
system("cd ./lib/ruby_app; clear; bundle exec ../../bin/ruby_app run")
|
22
22
|
end
|
23
23
|
|
24
|
-
namespace :clear do
|
25
|
-
|
26
|
-
desc 'Clear OpenID files'
|
27
|
-
task :open_id do |task|
|
28
|
-
system("rm -rf ./lib/ruby_app/elements/pages/authentication/open_id/associations")
|
29
|
-
system("rm -rf ./lib/ruby_app/elements/pages/authentication/open_id/nonces")
|
30
|
-
system("rm -rf ./lib/ruby_app/elements/pages/authentication/open_id/temp")
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
24
|
namespace :test do
|
36
25
|
|
37
26
|
desc 'Run feature tests for the given feature file or all features files if no argument is provided'
|
38
27
|
task :features, :file do |task, arguments|
|
39
|
-
system("bundle exec cucumber --format pretty --tags ~@broken #{arguments.file}")
|
28
|
+
system("bundle exec cucumber --format pretty --tags ~@broken --require features #{arguments.file}")
|
40
29
|
end
|
41
30
|
|
42
31
|
desc 'Run RSpec tests'
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'ruby_app/application'
|
4
|
+
|
5
|
+
describe RubyApp::Application do
|
6
|
+
include_context 'RubyApp::Application'
|
7
|
+
|
8
|
+
describe 'positive' do
|
9
|
+
|
10
|
+
describe 'class' do
|
11
|
+
|
12
|
+
specify { RubyApp::Application.should respond_to('create!') }
|
13
|
+
specify { RubyApp::Application.should respond_to('get') }
|
14
|
+
specify { RubyApp::Application.should respond_to('destroy!') }
|
15
|
+
|
16
|
+
specify { RubyApp::Application.get.should_not be_nil }
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
describe 'negative' do
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'ruby_app/configuration'
|
4
|
+
|
5
|
+
describe RubyApp::Configuration do
|
6
|
+
include_context 'RubyApp::Application'
|
7
|
+
|
8
|
+
describe 'positive' do
|
9
|
+
|
10
|
+
describe 'class' do
|
11
|
+
|
12
|
+
specify { RubyApp::Configuration.should respond_to('load!') }
|
13
|
+
specify { RubyApp::Configuration.should respond_to('get') }
|
14
|
+
specify { RubyApp::Configuration.should respond_to('unload!') }
|
15
|
+
|
16
|
+
specify { RubyApp::Configuration.get.should_not be_nil }
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
describe 'negative' do
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
data/spec/element_spec.rb
CHANGED
@@ -1,17 +1,66 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
require 'ruby_app/application'
|
4
3
|
require 'ruby_app/element'
|
5
4
|
|
6
5
|
describe RubyApp::Element do
|
7
|
-
include_context 'RubyApp::
|
6
|
+
include_context 'RubyApp::Request'
|
8
7
|
|
9
|
-
|
8
|
+
describe RubyApp::Element::Event do
|
9
|
+
|
10
|
+
describe 'positive' do
|
11
|
+
|
12
|
+
describe 'class' do
|
13
|
+
|
14
|
+
specify { RubyApp::Element::Event.should respond_to('from_hash') }
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
describe 'instance' do
|
19
|
+
|
20
|
+
let(:element) { RubyApp::Element.new }
|
21
|
+
let(:event) { RubyApp::Element::Event.new('source_id' => element.element_id) }
|
22
|
+
|
23
|
+
specify { event.should respond_to('source') }
|
24
|
+
specify { event.source.should_not be_nil }
|
25
|
+
specify { event.source.should == element }
|
26
|
+
|
27
|
+
specify { event.should respond_to('process!') }
|
28
|
+
specify { event.should respond_to('alert') }
|
29
|
+
specify { event.should respond_to('refresh') }
|
30
|
+
specify { event.should respond_to('show') }
|
31
|
+
specify { event.should respond_to('hide') }
|
32
|
+
specify { event.should respond_to('update_element') }
|
33
|
+
specify { event.should respond_to('update_text') }
|
34
|
+
specify { event.should respond_to('update_value') }
|
35
|
+
specify { event.should respond_to('go') }
|
36
|
+
specify { event.should respond_to('execute') }
|
37
|
+
specify { event.should respond_to('to_hash') }
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
describe 'negative' do
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
10
48
|
|
11
49
|
describe 'positive' do
|
12
50
|
|
13
|
-
describe '
|
14
|
-
|
51
|
+
describe 'class' do
|
52
|
+
|
53
|
+
specify { RubyApp::Element.should respond_to('get_element') }
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
describe 'instance' do
|
58
|
+
|
59
|
+
let(:element) { RubyApp::Element.new }
|
60
|
+
|
61
|
+
specify { element.should respond_to('attributes') }
|
62
|
+
specify { RubyApp::Element.get_element(element.element_id).should == element }
|
63
|
+
|
15
64
|
end
|
16
65
|
|
17
66
|
end
|
@@ -8,57 +8,49 @@ require 'ruby_app/elements/pages/test_pages/default_test_page'
|
|
8
8
|
require 'ruby_app/session'
|
9
9
|
|
10
10
|
describe RubyApp::Elements::Navigation::Breadcrumbs do
|
11
|
-
include_context 'RubyApp::
|
11
|
+
include_context 'RubyApp::Request'
|
12
12
|
|
13
13
|
describe 'positive' do
|
14
14
|
|
15
|
-
describe '
|
15
|
+
describe 'class' do
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
describe 'render :js' do
|
22
|
-
specify { RubyApp::Application.execute(environment) { RubyApp::Elements::Navigation::Breadcrumbs.render(:js).should_not be_nil } }
|
23
|
-
end
|
17
|
+
specify { RubyApp::Elements::Navigation::Breadcrumbs.render(:css).should be_nil }
|
18
|
+
specify { RubyApp::Elements::Navigation::Breadcrumbs.render(:js).should_not be_nil }
|
24
19
|
|
25
20
|
end
|
26
21
|
|
27
|
-
describe '
|
22
|
+
describe 'instance' do
|
28
23
|
|
29
24
|
let(:breadcrumbs) { RubyApp::Elements::Navigation::Breadcrumbs.new }
|
30
25
|
|
31
|
-
|
32
|
-
specify { RubyApp::Application.execute(environment) { breadcrumbs.render(:html).should_not be_nil } }
|
33
|
-
end
|
26
|
+
specify { breadcrumbs.render(:html).should_not be_nil }
|
34
27
|
|
35
28
|
end
|
36
29
|
|
37
|
-
describe '
|
30
|
+
describe 'pages' do
|
38
31
|
|
39
32
|
before(:all) do
|
40
|
-
RubyApp::
|
33
|
+
RubyApp::Session.pages.push(RubyApp::Elements::Pages::TestPages::DefaultTestPage.new)
|
41
34
|
end
|
42
35
|
|
43
36
|
let(:breadcrumbs) { RubyApp::Elements::Navigation::Breadcrumbs.new }
|
44
37
|
let(:first_page) { RubyApp::Session.pages.first }
|
45
38
|
let(:second_page) { RubyApp::Session.pages.last }
|
46
39
|
|
47
|
-
specify { RubyApp::
|
48
|
-
specify {
|
40
|
+
specify { RubyApp::Session.pages.length.should == 2 }
|
41
|
+
specify { breadcrumbs.render(:html).should include(first_page.translate.title) }
|
42
|
+
specify { breadcrumbs.render(:html).should include(second_page.translate.title) }
|
49
43
|
|
50
|
-
describe '
|
44
|
+
describe 'event' do
|
51
45
|
|
52
46
|
before(:all) do
|
53
|
-
RubyApp::
|
54
|
-
|
55
|
-
|
56
|
-
'page_id' => first_page.element_id }))
|
57
|
-
end
|
47
|
+
RubyApp::Element::Event.from_hash({ '_class' => 'RubyApp::Elements::Navigation::Base::BaseBreadcrumbs::ClickedEvent',
|
48
|
+
'source_id' => breadcrumbs.element_id,
|
49
|
+
'page_id' => first_page.element_id }).process!
|
58
50
|
end
|
59
51
|
|
60
|
-
specify { RubyApp::
|
61
|
-
specify { RubyApp::
|
52
|
+
specify { RubyApp::Session.pages.length.should == 1 }
|
53
|
+
specify { RubyApp::Session.pages.last.should == first_page }
|
62
54
|
|
63
55
|
end
|
64
56
|
|
data/spec/elements/page_spec.rb
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
require 'ruby_app/application'
|
4
3
|
require 'ruby_app/elements/page'
|
5
4
|
|
6
5
|
describe RubyApp::Elements::Page do
|
7
|
-
include_context 'RubyApp::
|
6
|
+
include_context 'RubyApp::Request'
|
8
7
|
|
9
8
|
describe 'positive' do
|
10
9
|
|
@@ -12,17 +11,7 @@ describe RubyApp::Elements::Page do
|
|
12
11
|
|
13
12
|
let(:page) { RubyApp::Elements::Page.new }
|
14
13
|
|
15
|
-
|
16
|
-
specify { RubyApp::Application.execute(environment) { page.render(:css).should_not be_nil } }
|
17
|
-
end
|
18
|
-
|
19
|
-
describe 'render :js' do
|
20
|
-
specify { RubyApp::Application.execute(environment) { page.render(:js).should_not be_nil } }
|
21
|
-
end
|
22
|
-
|
23
|
-
describe 'render :html' do
|
24
|
-
specify { RubyApp::Application.execute(environment) { page.render(:html).should_not be_nil } }
|
25
|
-
end
|
14
|
+
specify { page.should respond_to(:interval) }
|
26
15
|
|
27
16
|
end
|
28
17
|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'ruby_app/language'
|
4
|
+
|
5
|
+
describe RubyApp::Language do
|
6
|
+
include_context 'RubyApp::Request'
|
7
|
+
|
8
|
+
describe 'positive' do
|
9
|
+
|
10
|
+
describe 'class' do
|
11
|
+
|
12
|
+
specify { RubyApp::Language.should respond_to('load!') }
|
13
|
+
specify { RubyApp::Language.should respond_to('get') }
|
14
|
+
specify { RubyApp::Language.should respond_to('unload!') }
|
15
|
+
|
16
|
+
specify { RubyApp::Language.get.should_not be_nil }
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
describe 'negative' do
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
data/spec/log_spec.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'ruby_app/log'
|
4
|
+
|
5
|
+
describe RubyApp::Log do
|
6
|
+
include_context 'RubyApp::Application'
|
7
|
+
|
8
|
+
describe 'positive' do
|
9
|
+
|
10
|
+
describe 'class' do
|
11
|
+
|
12
|
+
specify { RubyApp::Log.should respond_to('open!') }
|
13
|
+
specify { RubyApp::Log.should respond_to('get') }
|
14
|
+
specify { RubyApp::Log.should respond_to('close!') }
|
15
|
+
|
16
|
+
specify { RubyApp::Log.get.should_not be_nil }
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
describe 'negative' do
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|