dismissible_helpers 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. data/README.md +146 -0
  2. data/Rakefile +10 -0
  3. data/app/assets/javascripts/dismissible_helpers.coffee +26 -0
  4. data/app/controllers/dismissed_helpers_controller.rb +3 -0
  5. data/app/helpers/dismissible_helpers_helper.rb +3 -0
  6. data/lib/dismissible_helpers/controllers/dismissed_helpers.rb +18 -0
  7. data/lib/dismissible_helpers/controllers.rb +4 -0
  8. data/lib/dismissible_helpers/engine.rb +7 -0
  9. data/lib/dismissible_helpers/helpers/dismissible_helpers.rb +26 -0
  10. data/lib/dismissible_helpers/helpers.rb +4 -0
  11. data/lib/dismissible_helpers/routes.rb +5 -0
  12. data/lib/dismissible_helpers/version.rb +3 -0
  13. data/lib/dismissible_helpers.rb +11 -0
  14. data/lib/tasks/dismissible_helpers_tasks.rake +4 -0
  15. data/spec/config/active_record.rb +9 -0
  16. data/spec/config/capybara.rb +7 -0
  17. data/spec/config/cookie_jar.rb +9 -0
  18. data/spec/config/database_cleaner.rb +20 -0
  19. data/spec/config/poltergeist.rb +7 -0
  20. data/spec/config/rspec.rb +3 -0
  21. data/spec/dummy/README.rdoc +261 -0
  22. data/spec/dummy/Rakefile +7 -0
  23. data/spec/dummy/app/assets/javascripts/application.coffee +6 -0
  24. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  25. data/spec/dummy/app/controllers/application_controller.rb +4 -0
  26. data/spec/dummy/app/controllers/landing_controller.rb +2 -0
  27. data/spec/dummy/app/controllers/sessions_controller.rb +9 -0
  28. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  29. data/spec/dummy/app/models/user.rb +7 -0
  30. data/spec/dummy/app/views/landing/show.html.erb +1 -0
  31. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  32. data/spec/dummy/config/application.rb +59 -0
  33. data/spec/dummy/config/boot.rb +10 -0
  34. data/spec/dummy/config/database.yml +11 -0
  35. data/spec/dummy/config/database.yml.example +11 -0
  36. data/spec/dummy/config/environment.rb +5 -0
  37. data/spec/dummy/config/environments/development.rb +37 -0
  38. data/spec/dummy/config/environments/production.rb +67 -0
  39. data/spec/dummy/config/environments/test.rb +37 -0
  40. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  41. data/spec/dummy/config/initializers/inflections.rb +15 -0
  42. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  43. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  44. data/spec/dummy/config/initializers/session_store.rb +8 -0
  45. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  46. data/spec/dummy/config/locales/en.yml +5 -0
  47. data/spec/dummy/config/routes.rb +6 -0
  48. data/spec/dummy/config.ru +4 -0
  49. data/spec/dummy/db/development.sqlite3 +0 -0
  50. data/spec/dummy/db/migrate/20121231010309_create_easy_auth_identities.easy_auth.rb +19 -0
  51. data/spec/dummy/db/migrate/20121231010454_create_users.rb +11 -0
  52. data/spec/dummy/db/schema.rb +40 -0
  53. data/spec/dummy/db/test.sqlite3 +0 -0
  54. data/spec/dummy/log/development.log +1489 -0
  55. data/spec/dummy/log/test.log +677 -0
  56. data/spec/dummy/public/404.html +26 -0
  57. data/spec/dummy/public/422.html +26 -0
  58. data/spec/dummy/public/500.html +25 -0
  59. data/spec/dummy/public/favicon.ico +0 -0
  60. data/spec/dummy/script/rails +6 -0
  61. data/spec/dummy/tmp/cache/assets/C4F/B20/sprockets%2F24f6108078517240a0f0797a7e5cf625 +0 -0
  62. data/spec/dummy/tmp/cache/assets/C50/D30/sprockets%2F1474665e253024aef8d1855624146e2e +0 -0
  63. data/spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  64. data/spec/dummy/tmp/cache/assets/CE3/590/sprockets%2F60f1e97d7008b3ed41f72855a4228bb9 +0 -0
  65. data/spec/dummy/tmp/cache/assets/D0B/350/sprockets%2F0c6a94a65b00a6e80488b89705ee0c5a +0 -0
  66. data/spec/dummy/tmp/cache/assets/D0C/F20/sprockets%2F3869efaa2d2da3e0349f0106b855b782 +0 -0
  67. data/spec/dummy/tmp/cache/assets/D23/B10/sprockets%2Fc2a831ed79df487d6485a5c9c52766c2 +0 -0
  68. data/spec/dummy/tmp/cache/assets/D27/020/sprockets%2F8b458f3566dbf9370d659bd554ba8c94 +0 -0
  69. data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  70. data/spec/dummy/tmp/cache/assets/D35/310/sprockets%2F4e9b874486a644b66eeef9e71945e48e +0 -0
  71. data/spec/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  72. data/spec/dummy/tmp/cache/assets/D50/A10/sprockets%2F3a2c2a214dd3ba1a0e4b7f52a96522f3 +0 -0
  73. data/spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  74. data/spec/dummy/tmp/cache/assets/D78/420/sprockets%2F854d9dd84c8d20bac9d9f741250e9b3a +0 -0
  75. data/spec/dummy/tmp/cache/assets/DAA/020/sprockets%2F7516ea1c5cf4d7b80fb9fd65153eff19 +0 -0
  76. data/spec/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  77. data/spec/dummy/tmp/cache/assets/DDF/AE0/sprockets%2F1fe879e6aff943d89f3f0cca571d2bc4 +0 -0
  78. data/spec/dummy/tmp/cache/assets/DE9/260/sprockets%2Fadd025ab0eb13a6d4180af43d5df39df +0 -0
  79. data/spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  80. data/spec/dummy/tmp/cache/assets/E72/C10/sprockets%2Fcee94ff2e026b6ecc66c7fcef96c1fc8 +0 -0
  81. data/spec/dummy/tmp/capybara/capybara-201212302021045993202744.html +29 -0
  82. data/spec/dummy/tmp/capybara/capybara-201212302021348367660995.html +29 -0
  83. data/spec/dummy/tmp/capybara/capybara-201212302023384130211415.html +29 -0
  84. data/spec/dummy/tmp/capybara/capybara-201212302103058314654716.html +29 -0
  85. data/spec/dummy/tmp/pids/server.pid +1 -0
  86. data/spec/requests/authenticated_spec.rb +15 -0
  87. data/spec/requests/step_helpers/authentication.rb +7 -0
  88. data/spec/requests/unauthenticated_spec.rb +13 -0
  89. data/spec/spec_helper.rb +31 -0
  90. data/spec/support/factories.rb +7 -0
  91. metadata +393 -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,29 @@
1
+ <!DOCTYPE html><html><head>
2
+ <title>Dummy</title>
3
+ <link href="/assets/application.css" media="all" rel="stylesheet" type="text/css">
4
+ <script src="/assets/application.js" type="text/javascript"></script>
5
+
6
+ </head>
7
+ <body>
8
+
9
+ <form accept-charset="UTF-8" action="/sign_in" class="new_identities_password" id="new_identities_password" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"></div>
10
+ <p>
11
+ <label for="identities_password_username">Username</label>
12
+ <input id="identities_password_username" name="identities_password[username]" size="30" type="text">
13
+ </p>
14
+ <p>
15
+ <label for="identities_password_password">Password</label>
16
+ <input id="identities_password_password" name="identities_password[password]" size="30" type="password">
17
+ </p>
18
+ <p>
19
+ <label for="identities_password_remember">Remember for 1 year</label>
20
+ <input name="identities_password[remember]" type="hidden" value="0"><input id="identities_password_remember" name="identities_password[remember]" type="checkbox" value="1">
21
+ </p>
22
+ <p>
23
+ <input name="commit" type="submit" value="Submit">
24
+ </p>
25
+ </form>
26
+
27
+
28
+
29
+ </body></html>
@@ -0,0 +1,29 @@
1
+ <!DOCTYPE html><html><head>
2
+ <title>Dummy</title>
3
+ <link href="/assets/application.css" media="all" rel="stylesheet" type="text/css">
4
+ <script src="/assets/application.js" type="text/javascript"></script>
5
+
6
+ </head>
7
+ <body>
8
+
9
+ <form accept-charset="UTF-8" action="/sign_in" class="new_identities_password" id="new_identities_password" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"></div>
10
+ <p>
11
+ <label for="identities_password_username">Username</label>
12
+ <input id="identities_password_username" name="identities_password[username]" size="30" type="text">
13
+ </p>
14
+ <p>
15
+ <label for="identities_password_password">Password</label>
16
+ <input id="identities_password_password" name="identities_password[password]" size="30" type="password">
17
+ </p>
18
+ <p>
19
+ <label for="identities_password_remember">Remember for 1 year</label>
20
+ <input name="identities_password[remember]" type="hidden" value="0"><input id="identities_password_remember" name="identities_password[remember]" type="checkbox" value="1">
21
+ </p>
22
+ <p>
23
+ <input name="commit" type="submit" value="Submit">
24
+ </p>
25
+ </form>
26
+
27
+
28
+
29
+ </body></html>
@@ -0,0 +1,29 @@
1
+ <!DOCTYPE html><html><head>
2
+ <title>Dummy</title>
3
+ <link href="/assets/application.css" media="all" rel="stylesheet" type="text/css">
4
+ <script src="/assets/application.js" type="text/javascript"></script>
5
+
6
+ </head>
7
+ <body>
8
+
9
+ <form accept-charset="UTF-8" action="/sign_in" class="new_identities_password" id="new_identities_password" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"></div>
10
+ <p>
11
+ <label for="identities_password_username">Username</label>
12
+ <input id="identities_password_username" name="identities_password[username]" size="30" type="text">
13
+ </p>
14
+ <p>
15
+ <label for="identities_password_password">Password</label>
16
+ <input id="identities_password_password" name="identities_password[password]" size="30" type="password">
17
+ </p>
18
+ <p>
19
+ <label for="identities_password_remember">Remember for 1 year</label>
20
+ <input name="identities_password[remember]" type="hidden" value="0"><input id="identities_password_remember" name="identities_password[remember]" type="checkbox" value="1">
21
+ </p>
22
+ <p>
23
+ <input name="commit" type="submit" value="Submit">
24
+ </p>
25
+ </form>
26
+
27
+
28
+
29
+ </body></html>
@@ -0,0 +1,29 @@
1
+ <!DOCTYPE html><html><head>
2
+ <title>Dummy</title>
3
+ <link href="/assets/application.css" media="all" rel="stylesheet" type="text/css">
4
+ <script src="/assets/application.js" type="text/javascript"></script>
5
+
6
+ </head>
7
+ <body>
8
+
9
+ <form accept-charset="UTF-8" action="/sign_in" class="new_identities_password" id="new_identities_password" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"></div>
10
+ <p>
11
+ <label for="identities_password_username">Username</label>
12
+ <input id="identities_password_username" name="identities_password[username]" size="30" type="text">
13
+ </p>
14
+ <p>
15
+ <label for="identities_password_password">Password</label>
16
+ <input id="identities_password_password" name="identities_password[password]" size="30" type="password">
17
+ </p>
18
+ <p>
19
+ <label for="identities_password_remember">Remember for 1 year</label>
20
+ <input name="identities_password[remember]" type="hidden" value="0"><input id="identities_password_remember" name="identities_password[remember]" type="checkbox" value="1">
21
+ </p>
22
+ <p>
23
+ <input name="commit" type="submit" value="Submit">
24
+ </p>
25
+ </form>
26
+
27
+
28
+
29
+ </body></html>
@@ -0,0 +1 @@
1
+ 6346
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ feature 'Signed in user', :js do
4
+ scenario 'Sees and dismisses helper' do
5
+ sign_in_as(create(:user))
6
+ page.should have_content 'Helper'
7
+ click_link 'Close'
8
+ sleep 1
9
+ page.should_not have_content 'Helper'
10
+ visit root_path
11
+ page.should_not have_content 'Helper'
12
+ visit sign_out_path
13
+ page.should have_content 'Helper'
14
+ end
15
+ end
@@ -0,0 +1,7 @@
1
+ def sign_in_as(account)
2
+ visit sign_in_path
3
+ fill_in 'Username', :with => account.email
4
+ fill_in 'Password', :with => account.password
5
+ click_button 'Submit'
6
+ account
7
+ end
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ feature 'Signed out user', :js do
4
+ scenario 'Sees and dismisses helper' do
5
+ visit root_path
6
+ page.should have_content 'Helper'
7
+ click_link 'Close'
8
+ sleep 1
9
+ page.should_not have_content 'Helper'
10
+ visit root_path
11
+ page.should_not have_content 'Helper'
12
+ end
13
+ end
@@ -0,0 +1,31 @@
1
+ require 'rubygems'
2
+ begin
3
+ require 'debugger'
4
+ rescue LoadError
5
+ end
6
+ begin
7
+ require 'ruby-debug'
8
+ rescue LoadError
9
+ end
10
+ require 'bundler/setup'
11
+
12
+ ENV['RAILS_ENV'] = 'test'
13
+ require File.expand_path('../dummy/config/environment.rb', __FILE__)
14
+ require 'capybara/rspec'
15
+ require 'rspec/rails'
16
+ require 'factory_girl_rails'
17
+
18
+ ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
19
+
20
+ Dir[File.join(ENGINE_RAILS_ROOT, 'spec/support/**/*.rb')].each { |f| require f }
21
+ Dir[File.join(ENGINE_RAILS_ROOT, 'spec/config/**/*.rb')].each { |f| require f }
22
+
23
+ RSpec.configure do |config|
24
+ config.mock_with :mocha
25
+ config.use_transactional_fixtures = true
26
+ config.include Factory::Syntax::Methods
27
+
28
+ config.before(:each, :type => :request) do
29
+ Dir[File.join(ENGINE_RAILS_ROOT, 'spec/requests/step_helpers/**/*.rb')].each { |f| require f }
30
+ end
31
+ end
@@ -0,0 +1,7 @@
1
+ FactoryGirl.define do
2
+ factory :user do
3
+ email 'test@example.com'
4
+ password 'password'
5
+ password_confirmation 'password'
6
+ end
7
+ end