inkwell_timelines 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.md +187 -0
- data/Rakefile +40 -0
- data/app/assets/images/inkwell_timelines/checkbox-checked.png +0 -0
- data/app/assets/images/inkwell_timelines/checkbox-unchecked.png +0 -0
- data/app/assets/images/inkwell_timelines/minus.png +0 -0
- data/app/assets/images/inkwell_timelines/plus.png +0 -0
- data/app/assets/images/inkwell_timelines/radiobutton_no.png +0 -0
- data/app/assets/images/inkwell_timelines/radiobutton_yes.png +0 -0
- data/app/assets/images/inkwell_timelines/up-down.png +0 -0
- data/app/assets/images/inkwell_timelines/wi-comment-hover.png +0 -0
- data/app/assets/images/inkwell_timelines/wi-comment.png +0 -0
- data/app/assets/images/inkwell_timelines/wi-favorite-active.png +0 -0
- data/app/assets/images/inkwell_timelines/wi-favorite-hover.png +0 -0
- data/app/assets/images/inkwell_timelines/wi-favorite.png +0 -0
- data/app/assets/images/inkwell_timelines/wi-reblog-active.png +0 -0
- data/app/assets/images/inkwell_timelines/wi-reblog-hover.png +0 -0
- data/app/assets/images/inkwell_timelines/wi-reblog.png +0 -0
- data/app/assets/javascripts/inkwell_timelines/index.js.erb +17 -0
- data/app/assets/javascripts/inkwell_timelines/inkwell_multi_selector.js +216 -0
- data/app/assets/javascripts/inkwell_timelines/inkwell_timeline.js.erb +149 -0
- data/app/assets/stylesheets/inkwell_timelines/index.css +30 -0
- data/app/assets/stylesheets/inkwell_timelines/multi_selector.css.erb +112 -0
- data/app/assets/stylesheets/inkwell_timelines/tab-menu.css +26 -0
- data/app/assets/stylesheets/inkwell_timelines/wall_item.css.erb +106 -0
- data/app/controllers/inkwell_timelines/application_controller.rb +4 -0
- data/app/helpers/inkwell_timelines/application_helper.rb +4 -0
- data/app/views/default_partials/_comment.html.erb +21 -0
- data/app/views/default_partials/_multi_selector.html.erb +15 -0
- data/app/views/default_partials/_multi_selector_items.html.erb +8 -0
- data/app/views/default_partials/_post.html.erb +22 -0
- data/app/views/default_partials/_tab_menu.html.erb +9 -0
- data/app/views/layouts/inkwell_timelines/application.html.erb +14 -0
- data/config/routes.rb +2 -0
- data/lib/inkwell_timelines.rb +6 -0
- data/lib/inkwell_timelines/engine.rb +5 -0
- data/lib/inkwell_timelines/version.rb +3 -0
- data/lib/main/to_controller.rb +22 -0
- data/lib/main/to_helpers.rb +93 -0
- data/lib/tasks/inkwell_timelines_tasks.rake +4 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +16 -0
- data/test/dummy/app/assets/javascripts/test.js +2 -0
- data/test/dummy/app/assets/stylesheets/application.css +14 -0
- data/test/dummy/app/assets/stylesheets/test.css +4 -0
- data/test/dummy/app/controllers/application_controller.rb +9 -0
- data/test/dummy/app/controllers/test_controller.rb +5 -0
- data/test/dummy/app/controllers/timeline_controller.rb +11 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/test_helper.rb +2 -0
- data/test/dummy/app/models/blogline.rb +3 -0
- data/test/dummy/app/models/bloglines_categories.rb +3 -0
- data/test/dummy/app/models/category.rb +7 -0
- data/test/dummy/app/models/comment.rb +16 -0
- data/test/dummy/app/models/favoriteline.rb +3 -0
- data/test/dummy/app/models/post.rb +16 -0
- data/test/dummy/app/models/user.rb +109 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/test/show.html.erb +1 -0
- data/test/dummy/app/views/timeline/show.html.erb +1 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/inkwell_timelines.rb +42 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +5 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20130422111954_create_posts.rb +16 -0
- data/test/dummy/db/migrate/20130422112200_create_users.rb +10 -0
- data/test/dummy/db/migrate/20130422112350_create_comments.rb +16 -0
- data/test/dummy/db/migrate/20130422112504_create_bloglines.rb +13 -0
- data/test/dummy/db/migrate/20130422112804_create_favoritelines.rb +11 -0
- data/test/dummy/db/migrate/20130422112954_create_categories.rb +14 -0
- data/test/dummy/db/migrate/20130422113135_create_bloglines_categories.rb +12 -0
- data/test/dummy/db/schema.rb +92 -0
- data/test/dummy/db/seeds.rb +625 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +104306 -0
- data/test/dummy/log/test.log +815 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/spec/helpers/test_helper_spec.rb +8 -0
- data/test/dummy/spec/spec_helper.rb +52 -0
- data/test/dummy/spec/watir/autoload_spec.rb +33 -0
- data/test/dummy/spec/watir/main_spec.rb +80 -0
- data/test/dummy/spec/watir/selector_spec.rb +103 -0
- data/test/dummy/spec/watir/tab_menu_spec.rb +36 -0
- data/test/dummy/tmp/cache/assets/C56/8F0/sprockets%2F1ad046fb9937420d5382984483fc8401 +0 -0
- data/test/dummy/tmp/cache/assets/C63/420/sprockets%2F5daa64d9601a1dd14726112003d08364 +0 -0
- data/test/dummy/tmp/cache/assets/C65/790/sprockets%2Feacce513669090988829f66e61634451 +0 -0
- data/test/dummy/tmp/cache/assets/C77/DD0/sprockets%2F055f9cd12326c5150492b8c584314fa3 +0 -0
- data/test/dummy/tmp/cache/assets/C84/E70/sprockets%2F0530f24346bbf970634035b6e55f886e +0 -0
- data/test/dummy/tmp/cache/assets/C85/420/sprockets%2F4734da42d41574596ab532629d0867ec +0 -0
- data/test/dummy/tmp/cache/assets/C87/A50/sprockets%2F667342f892546b573c52d11f814ae4f3 +0 -0
- data/test/dummy/tmp/cache/assets/CA1/750/sprockets%2Fa8471b3ea18986e7368e8273a95865e8 +0 -0
- data/test/dummy/tmp/cache/assets/CAC/DB0/sprockets%2Fc424393ee4e4f66aa4014619048753cb +0 -0
- data/test/dummy/tmp/cache/assets/CB2/170/sprockets%2F4479eb189646408ec3130b45153ebf7b +0 -0
- data/test/dummy/tmp/cache/assets/CB9/630/sprockets%2Fe5952cc2ece61727517547af4232892e +0 -0
- data/test/dummy/tmp/cache/assets/CBD/960/sprockets%2F5a35c922c979e889b0338374a9b3f4b0 +0 -0
- data/test/dummy/tmp/cache/assets/CC4/730/sprockets%2F78d0941e0543313bbb0a9f0cf630030d +0 -0
- data/test/dummy/tmp/cache/assets/CD1/F50/sprockets%2Fbf2261613d1c32c54a6e38a7673531fa +0 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/CD9/1E0/sprockets%2F293460f7bea2aea456231b769212f36f +0 -0
- data/test/dummy/tmp/cache/assets/CDC/EC0/sprockets%2Ff9a21d40846491577ab5ebe00de07077 +0 -0
- data/test/dummy/tmp/cache/assets/CE6/8D0/sprockets%2F9e823d2b49662dbb4389f2841a23e8c1 +0 -0
- data/test/dummy/tmp/cache/assets/CEE/110/sprockets%2Faf0654ff711843e082592cd70cf89a88 +0 -0
- data/test/dummy/tmp/cache/assets/CEE/490/sprockets%2F97139dc7ad35759531fc7fa572f0c761 +0 -0
- data/test/dummy/tmp/cache/assets/CF9/6F0/sprockets%2F952426cea414c6c2a04cc1216a1f36f5 +0 -0
- data/test/dummy/tmp/cache/assets/CFA/DE0/sprockets%2F25bf1e7766a300a4c37195df0cbb1107 +0 -0
- data/test/dummy/tmp/cache/assets/CFB/A10/sprockets%2F72699e3ed6f9c3984a718b62932ba66e +0 -0
- data/test/dummy/tmp/cache/assets/CFC/640/sprockets%2Fc7f89943cb904e76b2437e59348cc5c9 +0 -0
- data/test/dummy/tmp/cache/assets/D13/0C0/sprockets%2F218a6e24bfe5005a8a86798baa2585c8 +0 -0
- data/test/dummy/tmp/cache/assets/D13/3B0/sprockets%2F00cf5d507582a705af9694cde93ba186 +0 -0
- data/test/dummy/tmp/cache/assets/D13/6A0/sprockets%2F4819aa020210496ecf49ee70b78e8be6 +0 -0
- data/test/dummy/tmp/cache/assets/D15/560/sprockets%2Ff0007939832a29a27abe3a9579eed81c +0 -0
- data/test/dummy/tmp/cache/assets/D16/860/sprockets%2Fb45890d98668c132fee5cae4b15320d9 +0 -0
- data/test/dummy/tmp/cache/assets/D1A/150/sprockets%2F49ad9f8620b7712e6f2d4fc2e354e545 +0 -0
- data/test/dummy/tmp/cache/assets/D20/4F0/sprockets%2Fb15d3257899ad89007d1348eb9a5f5fe +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D36/810/sprockets%2Fb84416b6a4f5a39b0bc23ab72ad94279 +0 -0
- data/test/dummy/tmp/cache/assets/D39/390/sprockets%2F3c87a321da4296312f18efc704cd6d2f +0 -0
- data/test/dummy/tmp/cache/assets/D3A/260/sprockets%2F69551919ec05c0eb11e55bb59dc143ec +0 -0
- data/test/dummy/tmp/cache/assets/D41/350/sprockets%2F2111b16bc0081c14b803cfd350eb4baa +0 -0
- data/test/dummy/tmp/cache/assets/D43/D20/sprockets%2Fbcbf2f35591e507593ec6116eac6e924 +0 -0
- data/test/dummy/tmp/cache/assets/D48/3C0/sprockets%2F41be77d9f6b62168967ca14ccc6b51d6 +0 -0
- data/test/dummy/tmp/cache/assets/D4D/7C0/sprockets%2F5f4f24c2540cffe8b3c5e835756c35f7 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D51/6A0/sprockets%2F80b05d6f75c78bdb1e450c898e47d97a +0 -0
- data/test/dummy/tmp/cache/assets/D56/4C0/sprockets%2F66059379b6c72ffe570f4ae394a89eda +0 -0
- data/test/dummy/tmp/cache/assets/D56/D30/sprockets%2Fe910c76d93fd4da6984d82e469f62f0c +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/D65/600/sprockets%2Fdaa0e3c217673cb0ebb89d97438a1b80 +0 -0
- data/test/dummy/tmp/cache/assets/D66/6C0/sprockets%2Fa06355ade2a095c01afd8c6f5e67019d +0 -0
- data/test/dummy/tmp/cache/assets/D6A/E70/sprockets%2Fc9f71142e4d4a807cb6be80451f74adb +0 -0
- data/test/dummy/tmp/cache/assets/D76/E50/sprockets%2F6289e3eb865565eab3fdfb4fae810702 +0 -0
- data/test/dummy/tmp/cache/assets/D86/6A0/sprockets%2Fac97d7e4e37faa819a833c7c52c9e687 +0 -0
- data/test/dummy/tmp/cache/assets/D91/C00/sprockets%2Fb1cf6c48f161db0a058d10817ddd5e5b +0 -0
- data/test/dummy/tmp/cache/assets/D9C/C90/sprockets%2Fa903431f8703bbaafcae42e4f4692ff8 +0 -0
- data/test/dummy/tmp/cache/assets/DA0/C60/sprockets%2F90d8e40e6baa19d6556ab9c6ac891a2e +0 -0
- data/test/dummy/tmp/cache/assets/DA1/F90/sprockets%2F3bd196480867f8e3c74b10dbcbbe1f9b +0 -0
- data/test/dummy/tmp/cache/assets/DA7/EE0/sprockets%2Ffced4a1e089dc82bf773475da4e53c46 +0 -0
- data/test/dummy/tmp/cache/assets/DA9/4D0/sprockets%2F3d68828b990fbfa9cdf51daa76c242d5 +0 -0
- data/test/dummy/tmp/cache/assets/DB5/4C0/sprockets%2F5e815df4827231fe949b2f9bffd0d9de +0 -0
- data/test/dummy/tmp/cache/assets/DB6/910/sprockets%2F3c19b64141a5ceeccf3a3baf4c452a06 +0 -0
- data/test/dummy/tmp/cache/assets/DC4/8D0/sprockets%2Fd8daccd2ece841a83a2a584c50e352d5 +0 -0
- data/test/dummy/tmp/cache/assets/DCC/6A0/sprockets%2Fa92fb625cc83fe72fc4115e2fb2ed61e +0 -0
- data/test/dummy/tmp/cache/assets/DCC/940/sprockets%2Fe7f0ee8bf122b8b72b8e3c7cd13a5d81 +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E08/E50/sprockets%2F22c72aded517c5cdf8cce6f4b58c76b8 +0 -0
- data/test/dummy/tmp/cache/assets/E24/740/sprockets%2F2ecee9c0ae221af87da9c5d034c8dd0c +0 -0
- data/test/dummy/tmp/cache/assets/E2D/160/sprockets%2Fdb479da69eeed6322f3b8dab3bf91bb0 +0 -0
- data/test/dummy/tmp/cache/assets/E4C/810/sprockets%2Fdaf244418a8cfda1aca3e32dbdf17fd2 +0 -0
- data/test/dummy/tmp/pids/server.pid +1 -0
- data/test/screen/main.png +0 -0
- data/test/test_helper.rb +15 -0
- metadata +413 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
</div>
|
24
|
+
</body>
|
25
|
+
</html>
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require File.expand_path("../../config/environment", __FILE__)
|
4
|
+
require 'rspec/rails'
|
5
|
+
require 'rspec/autorun'
|
6
|
+
require 'database_cleaner'
|
7
|
+
|
8
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
9
|
+
# in spec/support/ and its subdirectories.
|
10
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
11
|
+
|
12
|
+
RSpec.configure do |config|
|
13
|
+
# ## Mock Framework
|
14
|
+
#
|
15
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
16
|
+
#
|
17
|
+
# config.mock_with :mocha
|
18
|
+
# config.mock_with :flexmock
|
19
|
+
# config.mock_with :rr
|
20
|
+
|
21
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
22
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
23
|
+
|
24
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
25
|
+
# examples within a transaction, remove the following line or assign false
|
26
|
+
# instead of true.
|
27
|
+
config.use_transactional_fixtures = true
|
28
|
+
|
29
|
+
# If true, the base class of anonymous controllers will be inferred
|
30
|
+
# automatically. This will be the default behavior in future versions of
|
31
|
+
# rspec-rails.
|
32
|
+
config.infer_base_class_for_anonymous_controllers = false
|
33
|
+
|
34
|
+
# Run specs in random order to surface order dependencies. If you find an
|
35
|
+
# order dependency and want to debug it, you can fix the order by providing
|
36
|
+
# the seed, which is printed after each run.
|
37
|
+
# --seed 1234
|
38
|
+
config.order = "random"
|
39
|
+
|
40
|
+
config.before(:suite) do
|
41
|
+
DatabaseCleaner.strategy = :truncation
|
42
|
+
end
|
43
|
+
|
44
|
+
config.before(:each) do
|
45
|
+
DatabaseCleaner.clean
|
46
|
+
DatabaseCleaner.start
|
47
|
+
end
|
48
|
+
|
49
|
+
config.after(:each) do
|
50
|
+
DatabaseCleaner.clean
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'watir-webdriver'
|
3
|
+
|
4
|
+
describe 'Main' do
|
5
|
+
|
6
|
+
before(:all) do
|
7
|
+
@browser = Watir::Browser.new
|
8
|
+
@browser.goto "http://0.0.0.0:3000/"
|
9
|
+
@inkwell_timeline = @browser.div(:class => /inkwell_timelines/, :id => /timelines_block/)
|
10
|
+
end
|
11
|
+
|
12
|
+
after(:all) do
|
13
|
+
@browser.close
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'new items should be autoloaded' do
|
17
|
+
@browser.execute_script("window.scrollBy(0,document.documentElement.scrollHeight)")
|
18
|
+
@browser.wait_until {@inkwell_timeline.div(:id => /blogline_14/).exists?}
|
19
|
+
(5..13).each {|i| @inkwell_timeline.div(:id => /blogline_#{i}/).exists?.should == true}
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'not default timeline should be autoloaded' do
|
23
|
+
@inkwell_timeline.span(:class => /timeline_favoriteline/).click
|
24
|
+
@browser.wait_until {@inkwell_timeline.div(:class => /wall_item/, :id => /favoriteline_13/).exists?}
|
25
|
+
@browser.execute_script("window.scrollBy(0,document.documentElement.scrollHeight)")
|
26
|
+
@browser.wait_until {@inkwell_timeline.div(:class => /wall_item/, :id => /favoriteline_3/).exists?}
|
27
|
+
wall_items = @browser.divs(:class => /wall_item/)
|
28
|
+
wall_items.size.should == 13
|
29
|
+
(1..2).each do |i|
|
30
|
+
wall_items.select { |item| item.id =~ /favoriteline_#{i}$/ }.size.should == 1
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'watir-webdriver'
|
3
|
+
|
4
|
+
describe 'Main' do
|
5
|
+
|
6
|
+
before(:all) do
|
7
|
+
@browser = Watir::Browser.new
|
8
|
+
@browser.goto "http://0.0.0.0:3000/"
|
9
|
+
end
|
10
|
+
|
11
|
+
after(:all) do
|
12
|
+
@browser.close
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'tab menu items should be' do
|
16
|
+
@browser.span(:class => /timeline_favoriteline/).exists?.should == true
|
17
|
+
@browser.span(:class => /timeline_blogline/).exists?.should == true
|
18
|
+
@browser.span(:class => /timeline_blogline/).class_name.include?('active').should == true
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'selector should be' do
|
22
|
+
selector = @browser.div(:class => /inkwell_multi_selector/)
|
23
|
+
selector.exists?.should == true
|
24
|
+
selector.span(:class => /name/, :text => /Category:/).exists?.should == true
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'wall items should be' do
|
28
|
+
wall_items = @browser.divs(:class => /wall_item/)
|
29
|
+
wall_items.size.should == 10
|
30
|
+
(15..24).each do |i|
|
31
|
+
wall_items.select {|item| item.id =~ /blogline_#{i}/}.size.should == 1
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'post items should be' do
|
36
|
+
wall_item = @browser.div(:id => /blogline_24/)
|
37
|
+
wall_item.image(:class => /avatar/).exists?.should == true
|
38
|
+
wall_item.span(:class => /name/, :text => /^Alexander Pushkin:$/).exists?.should == true
|
39
|
+
wall_item.span(:class => /title/, :text => /^A wish$/).exists?.should == true
|
40
|
+
wall_item.div(:class => /item_container/).image(:class => /^item_img$/).exists?.should == true
|
41
|
+
wall_item.p(:text => /My days still linger, slow and rough/).exists?.should == true
|
42
|
+
item_menu = wall_item.div(:class => /item_menu/)
|
43
|
+
item_menu.exists?.should == true
|
44
|
+
favorite_item = item_menu.span(:class => /favorite_action/, :text => /^1$/)
|
45
|
+
favorite_item.exists?.should == true
|
46
|
+
favorite_item.class_name.include?('active').should == true
|
47
|
+
reblog_item = item_menu.span(:class => /reblog_action/, :text => /^1$/)
|
48
|
+
reblog_item.exists?.should == true
|
49
|
+
reblog_item.class_name.include?('active').should == true
|
50
|
+
comment_item = item_menu.span(:class => /comment_action/, :text => /^1$/)
|
51
|
+
comment_item.exists?.should == true
|
52
|
+
date = item_menu.span(:class => /date/, :text => /\..*\..*:/)
|
53
|
+
date.exists?.should == true
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'comment should be' do
|
57
|
+
wall_item = @browser.div(:id => /blogline_21/)
|
58
|
+
wall_item.image(:class => /avatar/).exists?.should == true
|
59
|
+
wall_item.span(:class => /name/, :text => /^Alexander Pushkin:$/).exists?.should == true
|
60
|
+
wall_item.p(:text => /Alas! How come she's glimmering With temporary/).exists?.should == true
|
61
|
+
item_menu = wall_item.div(:class => /item_menu/)
|
62
|
+
item_menu.exists?.should == true
|
63
|
+
favorite_item = item_menu.span(:class => /favorite_action/, :text => /^1$/)
|
64
|
+
favorite_item.exists?.should == true
|
65
|
+
favorite_item.class_name.include?('active').should == true
|
66
|
+
reblog_item = item_menu.span(:class => /reblog_action/, :text => /^1$/)
|
67
|
+
reblog_item.exists?.should == true
|
68
|
+
reblog_item.class_name.include?('active').should == true
|
69
|
+
comment_item = item_menu.span(:class => /comment_action/, :text => /^1$/)
|
70
|
+
comment_item.exists?.should == true
|
71
|
+
date = item_menu.span(:class => /date/, :text => /\..*\..*:/)
|
72
|
+
date.exists?.should == true
|
73
|
+
end
|
74
|
+
|
75
|
+
it 'hidden transferred_params should be' do
|
76
|
+
inkwell_timelines = @browser.div(:class => /inkwell_timelines/, :id => /timelines_block/)
|
77
|
+
inkwell_timelines.hidden(:class => /(?=.*transferred_params)(?=.*blogline)/, :value => /{"user_id":1}/).exists?.should == true
|
78
|
+
inkwell_timelines.hidden(:class => /(?=.*transferred_params)(?=.*favoriteline)/, :value => /{"user_id":1}/).exists?.should == true
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'watir-webdriver'
|
3
|
+
|
4
|
+
describe 'Main' do
|
5
|
+
|
6
|
+
before(:all) do
|
7
|
+
@browser = Watir::Browser.new
|
8
|
+
@browser.goto "http://0.0.0.0:3000/"
|
9
|
+
@inkwell_timeline = @browser.div(:class => /inkwell_timelines/, :id => /timelines_block/)
|
10
|
+
@selector = @inkwell_timeline.div(:class => /inkwell_multi_selector/)
|
11
|
+
end
|
12
|
+
|
13
|
+
before(:each) do
|
14
|
+
@browser.refresh
|
15
|
+
end
|
16
|
+
|
17
|
+
after(:all) do
|
18
|
+
@browser.close
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'dropdown should be displayed and hided on user actions' do
|
22
|
+
@selector.div(:class => /action/).click
|
23
|
+
@browser.wait_until {@selector.div(:class => /dropdown/).visible? }
|
24
|
+
@selector.div(:class => /action/).click
|
25
|
+
@browser.wait_until {!@selector.div(:class => /dropdown/).visible?}
|
26
|
+
|
27
|
+
@selector.div(:class => /action/).click
|
28
|
+
@browser.wait_until {@selector.div(:class => /dropdown/).visible?}
|
29
|
+
@inkwell_timeline.click
|
30
|
+
@browser.wait_until {!@selector.div(:class => /dropdown/).visible?}
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'all checkboxes should be checked and synchronized with state on first load' do
|
34
|
+
checkboxes = @selector.spans(:class => /(?=.*checkbox_with_label)(?=.*checked)/)
|
35
|
+
checkboxes.size.should == 9
|
36
|
+
states = @selector.spans(:id => /inkwell_category_state_/)
|
37
|
+
states.size.should == 4
|
38
|
+
[1,2,7,8].each do |i|
|
39
|
+
checkboxes.select { |item| item.id =~ /inkwell_category_checkbox_#{i}$/ }.size.should == 1
|
40
|
+
states.select { |item| item.id =~ /inkwell_category_state_#{i}$/ }.size.should == 1
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'checkbox should be checked/unchecked on click' do
|
45
|
+
@selector.div(:class => /action/).click
|
46
|
+
@browser.wait_until {@selector.div(:class => /dropdown/).visible? }
|
47
|
+
checkbox = @selector.span(:id => /inkwell_category_checkbox_1/)
|
48
|
+
checkbox.class_name.include?('checked').should == true
|
49
|
+
@selector.span(:id => /inkwell_category_state_1/).exists?.should == true
|
50
|
+
checkbox.click
|
51
|
+
checkbox.class_name.include?('checked').should == false
|
52
|
+
@selector.span(:id => /inkwell_category_state_1/).exists?.should == false
|
53
|
+
checkbox.click
|
54
|
+
checkbox.class_name.include?('checked').should == true
|
55
|
+
@selector.span(:id => /inkwell_category_state_1/).exists?.should == true
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'upper checkboxes should be unchecked after uncheck their child (2-level)' do
|
59
|
+
@selector.div(:class => /action/).click
|
60
|
+
@browser.wait_until {@selector.div(:class => /dropdown/).visible? }
|
61
|
+
@selector.spans(:class => /(?=.*nesting)(?=.*collapsed)/).each {|span| span.click if span.visible?}
|
62
|
+
@selector.span(:id => /inkwell_category_checkbox_3/).click
|
63
|
+
@selector.span(:id => /inkwell_category_checkbox_2/).class_name.include?('checked').should == false
|
64
|
+
@selector.span(:id => /inkwell_category_state_2/).exists?.should == false
|
65
|
+
@selector.span(:id => /inkwell_category_state_3/).exists?.should == false
|
66
|
+
@selector.span(:id => /inkwell_category_state_4/).exists?.should == true
|
67
|
+
@selector.span(:id => /inkwell_category_state_5/).exists?.should == true
|
68
|
+
@selector.span(:id => /inkwell_category_state_6/).exists?.should == true
|
69
|
+
end
|
70
|
+
|
71
|
+
it 'upper checkboxes should be unchecked after uncheck their child (3-level)' do
|
72
|
+
@selector.div(:class => /action/).click
|
73
|
+
@browser.wait_until { @selector.div(:class => /dropdown/).visible? }
|
74
|
+
@selector.spans(:class => /(?=.*nesting)(?=.*collapsed)/).each { |span| span.click if span.visible? }
|
75
|
+
@selector.spans(:class => /(?=.*nesting)(?=.*collapsed)/).each { |span| span.click if span.visible? }
|
76
|
+
@selector.span(:id => /inkwell_category_checkbox_4/).click
|
77
|
+
@selector.span(:id => /inkwell_category_checkbox_2/).class_name.include?('checked').should == false
|
78
|
+
@selector.span(:id => /inkwell_category_checkbox_3/).class_name.include?('checked').should == false
|
79
|
+
@selector.span(:id => /inkwell_category_state_2/).exists?.should == false
|
80
|
+
@selector.span(:id => /inkwell_category_state_3/).exists?.should == false
|
81
|
+
@selector.span(:id => /inkwell_category_state_4/).exists?.should == false
|
82
|
+
@selector.span(:id => /inkwell_category_state_5/).exists?.should == true
|
83
|
+
@selector.span(:id => /inkwell_category_state_6/).exists?.should == true
|
84
|
+
end
|
85
|
+
|
86
|
+
it 'child checkboxes should be checked after check their parent' do
|
87
|
+
@selector.div(:class => /action/).click
|
88
|
+
@browser.wait_until { @selector.div(:class => /dropdown/).visible? }
|
89
|
+
@selector.spans(:class => /(?=.*nesting)(?=.*collapsed)/).each { |span| span.click if span.visible? }
|
90
|
+
@selector.spans(:class => /(?=.*nesting)(?=.*collapsed)/).each { |span| span.click if span.visible? }
|
91
|
+
@selector.span(:id => /inkwell_category_checkbox_4/).click
|
92
|
+
@selector.span(:id => /inkwell_category_checkbox_5/).click
|
93
|
+
@selector.span(:id => /inkwell_category_checkbox_2/).click
|
94
|
+
@selector.span(:id => /inkwell_category_checkbox_2/).class_name.include?('checked').should == true
|
95
|
+
@selector.span(:id => /inkwell_category_checkbox_3/).class_name.include?('checked').should == true
|
96
|
+
@selector.span(:id => /inkwell_category_checkbox_4/).class_name.include?('checked').should == true
|
97
|
+
@selector.span(:id => /inkwell_category_checkbox_5/).class_name.include?('checked').should == true
|
98
|
+
@selector.span(:id => /inkwell_category_state_2/).exists?.should == true
|
99
|
+
@selector.span(:id => /inkwell_category_state_5/).exists?.should == false
|
100
|
+
@selector.span(:id => /inkwell_category_state_3/).exists?.should == false
|
101
|
+
@selector.span(:id => /inkwell_category_state_4/).exists?.should == false
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'watir-webdriver'
|
3
|
+
|
4
|
+
describe 'Main' do
|
5
|
+
|
6
|
+
before(:all) do
|
7
|
+
@browser = Watir::Browser.new
|
8
|
+
@browser.goto "http://0.0.0.0:3000/"
|
9
|
+
@inkwell_timeline = @browser.div(:class => /inkwell_timelines/, :id => /timelines_block/)
|
10
|
+
end
|
11
|
+
|
12
|
+
after(:all) do
|
13
|
+
@browser.close
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'favorite line should be displayed after click on Favorite tab' do
|
17
|
+
@inkwell_timeline.span(:class => /timeline_favoriteline/).click
|
18
|
+
@browser.wait_until {@inkwell_timeline.div(:class => /wall_item/, :id => /favoriteline_13/).exists?}
|
19
|
+
wall_items = @browser.divs(:class => /wall_item/)
|
20
|
+
wall_items.size.should == 10
|
21
|
+
(4..12).each do |i|
|
22
|
+
wall_items.select { |item| item.id =~ /favoriteline_#{i}$/ }.size.should == 1
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'tab should receive active class on click' do
|
27
|
+
blogline = @inkwell_timeline.span(:class => /timeline_blogline/)
|
28
|
+
blogline.click
|
29
|
+
blogline.class_name.include?('active').should == true
|
30
|
+
favoriteline = @inkwell_timeline.span(:class => /timeline_favoriteline/)
|
31
|
+
favoriteline.class_name.include?('active').should == false
|
32
|
+
favoriteline.click
|
33
|
+
favoriteline.class_name.include?('active').should == true
|
34
|
+
blogline.class_name.include?('active').should == false
|
35
|
+
end
|
36
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|