dismissible_helpers 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +146 -0
- data/Rakefile +10 -0
- data/app/assets/javascripts/dismissible_helpers.coffee +26 -0
- data/app/controllers/dismissed_helpers_controller.rb +3 -0
- data/app/helpers/dismissible_helpers_helper.rb +3 -0
- data/lib/dismissible_helpers/controllers/dismissed_helpers.rb +18 -0
- data/lib/dismissible_helpers/controllers.rb +4 -0
- data/lib/dismissible_helpers/engine.rb +7 -0
- data/lib/dismissible_helpers/helpers/dismissible_helpers.rb +26 -0
- data/lib/dismissible_helpers/helpers.rb +4 -0
- data/lib/dismissible_helpers/routes.rb +5 -0
- data/lib/dismissible_helpers/version.rb +3 -0
- data/lib/dismissible_helpers.rb +11 -0
- data/lib/tasks/dismissible_helpers_tasks.rake +4 -0
- data/spec/config/active_record.rb +9 -0
- data/spec/config/capybara.rb +7 -0
- data/spec/config/cookie_jar.rb +9 -0
- data/spec/config/database_cleaner.rb +20 -0
- data/spec/config/poltergeist.rb +7 -0
- data/spec/config/rspec.rb +3 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.coffee +6 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +4 -0
- data/spec/dummy/app/controllers/landing_controller.rb +2 -0
- data/spec/dummy/app/controllers/sessions_controller.rb +9 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/user.rb +7 -0
- data/spec/dummy/app/views/landing/show.html.erb +1 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config/application.rb +59 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +11 -0
- data/spec/dummy/config/database.yml.example +11 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +6 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20121231010309_create_easy_auth_identities.easy_auth.rb +19 -0
- data/spec/dummy/db/migrate/20121231010454_create_users.rb +11 -0
- data/spec/dummy/db/schema.rb +40 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +1489 -0
- data/spec/dummy/log/test.log +677 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/tmp/cache/assets/C4F/B20/sprockets%2F24f6108078517240a0f0797a7e5cf625 +0 -0
- data/spec/dummy/tmp/cache/assets/C50/D30/sprockets%2F1474665e253024aef8d1855624146e2e +0 -0
- data/spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/CE3/590/sprockets%2F60f1e97d7008b3ed41f72855a4228bb9 +0 -0
- data/spec/dummy/tmp/cache/assets/D0B/350/sprockets%2F0c6a94a65b00a6e80488b89705ee0c5a +0 -0
- data/spec/dummy/tmp/cache/assets/D0C/F20/sprockets%2F3869efaa2d2da3e0349f0106b855b782 +0 -0
- data/spec/dummy/tmp/cache/assets/D23/B10/sprockets%2Fc2a831ed79df487d6485a5c9c52766c2 +0 -0
- data/spec/dummy/tmp/cache/assets/D27/020/sprockets%2F8b458f3566dbf9370d659bd554ba8c94 +0 -0
- data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/D35/310/sprockets%2F4e9b874486a644b66eeef9e71945e48e +0 -0
- data/spec/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/dummy/tmp/cache/assets/D50/A10/sprockets%2F3a2c2a214dd3ba1a0e4b7f52a96522f3 +0 -0
- data/spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/D78/420/sprockets%2F854d9dd84c8d20bac9d9f741250e9b3a +0 -0
- data/spec/dummy/tmp/cache/assets/DAA/020/sprockets%2F7516ea1c5cf4d7b80fb9fd65153eff19 +0 -0
- data/spec/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/dummy/tmp/cache/assets/DDF/AE0/sprockets%2F1fe879e6aff943d89f3f0cca571d2bc4 +0 -0
- data/spec/dummy/tmp/cache/assets/DE9/260/sprockets%2Fadd025ab0eb13a6d4180af43d5df39df +0 -0
- data/spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/E72/C10/sprockets%2Fcee94ff2e026b6ecc66c7fcef96c1fc8 +0 -0
- data/spec/dummy/tmp/capybara/capybara-201212302021045993202744.html +29 -0
- data/spec/dummy/tmp/capybara/capybara-201212302021348367660995.html +29 -0
- data/spec/dummy/tmp/capybara/capybara-201212302023384130211415.html +29 -0
- data/spec/dummy/tmp/capybara/capybara-201212302103058314654716.html +29 -0
- data/spec/dummy/tmp/pids/server.pid +1 -0
- data/spec/requests/authenticated_spec.rb +15 -0
- data/spec/requests/step_helpers/authentication.rb +7 -0
- data/spec/requests/unauthenticated_spec.rb +13 -0
- data/spec/spec_helper.rb +31 -0
- data/spec/support/factories.rb +7 -0
- 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'
|
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
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -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,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
|
data/spec/spec_helper.rb
ADDED
@@ -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
|