iugusdk 1.0.0.alpha.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.rdoc +3 -0
- data/Rakefile +39 -0
- data/app/assets/images/application_logo.png +0 -0
- data/app/assets/javascripts/settings.js +10 -0
- data/app/assets/javascripts/settings_code.js.coffee.erb +0 -0
- data/app/assets/stylesheets/settings.sass +120 -0
- data/app/controllers/iugu/account_controller.rb +63 -0
- data/app/controllers/iugu/account_domains_controller.rb +64 -0
- data/app/controllers/iugu/account_roles_controller.rb +20 -0
- data/app/controllers/iugu/account_settings_controller.rb +17 -0
- data/app/controllers/iugu/account_users_controller.rb +43 -0
- data/app/controllers/iugu/application_domain_controller.rb +11 -0
- data/app/controllers/iugu/confirmations_controller.rb +2 -0
- data/app/controllers/iugu/invitations_controller.rb +49 -0
- data/app/controllers/iugu/omniauth_callbacks_controller.rb +23 -0
- data/app/controllers/iugu/passwords_controller.rb +2 -0
- data/app/controllers/iugu/profile_controller.rb +44 -0
- data/app/controllers/iugu/registrations_controller.rb +3 -0
- data/app/controllers/iugu/sessions_controller.rb +2 -0
- data/app/controllers/iugu/settings_controller.rb +11 -0
- data/app/controllers/iugu/unlocks_controller.rb +2 -0
- data/app/mailers/iugu_mailer.rb +16 -0
- data/app/models/account.rb +53 -0
- data/app/models/account_domain.rb +69 -0
- data/app/models/account_role.rb +24 -0
- data/app/models/account_user.rb +55 -0
- data/app/models/available_language.rb +10 -0
- data/app/models/social_account.rb +14 -0
- data/app/models/user.rb +107 -0
- data/app/models/user_invitation.rb +39 -0
- data/app/validators/email_validator.rb +17 -0
- data/app/views/iugu-old/account_settings.html.haml +17 -0
- data/app/views/iugu-old/login.html.haml +28 -0
- data/app/views/iugu-old/mails/confirmation_instructions.html.erb +5 -0
- data/app/views/iugu-old/mails/reset_password_instructions.html.erb +8 -0
- data/app/views/iugu-old/mails/unlock_instructions.html.erb +7 -0
- data/app/views/iugu-old/profile_settings.html.haml +76 -0
- data/app/views/iugu-old/signup.html.haml +36 -0
- data/app/views/iugu/account_domains/index.html.haml +33 -0
- data/app/views/iugu/account_domains/instructions.html.haml +0 -0
- data/app/views/iugu/account_roles/edit.html.haml +17 -0
- data/app/views/iugu/account_roles/update.html.haml +0 -0
- data/app/views/iugu/account_users/index.html.haml +23 -0
- data/app/views/iugu/account_users/view.html.haml +0 -0
- data/app/views/iugu/confirmations/new.html.haml +8 -0
- data/app/views/iugu/invitations/edit.html.haml +8 -0
- data/app/views/iugu/invitations/new.html.haml +13 -0
- data/app/views/iugu/mailer/confirmation_instructions.html.haml +4 -0
- data/app/views/iugu/mailer/invitation.html.haml +1 -0
- data/app/views/iugu/mailer/reset_password_instructions.html.haml +4 -0
- data/app/views/iugu/mailer/unlock_instructions.html.haml +5 -0
- data/app/views/iugu/passwords/edit.html.haml +11 -0
- data/app/views/iugu/passwords/new.html.haml +8 -0
- data/app/views/iugu/registrations/edit.html.haml +15 -0
- data/app/views/iugu/registrations/new.html.haml +11 -0
- data/app/views/iugu/sessions/new.html.haml +9 -0
- data/app/views/iugu/settings/account.html.haml +48 -0
- data/app/views/iugu/settings/accounts.html.haml +33 -0
- data/app/views/iugu/settings/profile.html.haml +96 -0
- data/app/views/iugu/shared/_links.haml +19 -0
- data/app/views/iugu/unlocks/new.html.haml +8 -0
- data/app/views/layouts/settings.html.haml +46 -0
- data/config/initializers/account_roles.rb +5 -0
- data/config/initializers/devise.rb +242 -0
- data/config/initializers/social_accounts.rb +16 -0
- data/config/locales/devise.en.yml +57 -0
- data/config/locales/devise.pt-BR.yml +55 -0
- data/config/locales/iugu.en.yml +73 -0
- data/config/locales/iugu.pt-BR.yml +73 -0
- data/config/routes.rb +77 -0
- data/db/migrate/20120528164634_create_account.rb +11 -0
- data/db/migrate/20120529134109_add_devise_to_users.rb +53 -0
- data/db/migrate/20120529162901_add_birthdate_and_name_to_user.rb +12 -0
- data/db/migrate/20120529174755_add_name_and_subscription_id_and_user_id_to_account.rb +13 -0
- data/db/migrate/20120529180814_create_account_users.rb +12 -0
- data/db/migrate/20120530114709_remove_user_id_from_accounts.rb +9 -0
- data/db/migrate/20120531171438_create_account_roles.rb +12 -0
- data/db/migrate/20120604131034_add_locale_to_user.rb +9 -0
- data/db/migrate/20120605142527_create_social_account.rb +15 -0
- data/db/migrate/20120612141130_set_locale.rb +6 -0
- data/db/migrate/20120613173114_remove_unique_from_user_email.rb +11 -0
- data/db/migrate/20120615180728_create_delayed_jobs.rb +22 -0
- data/db/migrate/20120629154429_create_user_invitations.rb +14 -0
- data/db/migrate/20120629195345_add_token_to_user_invitations.rb +8 -0
- data/db/migrate/20120705202827_add_roles_to_user_invitations.rb +8 -0
- data/db/migrate/20120716145846_create_account_domain.rb +14 -0
- data/db/migrate/20120719162426_add_subdomain_to_account.rb +9 -0
- data/lib/iugusdk.rb +73 -0
- data/lib/iugusdk/controllers/helpers.rb +45 -0
- data/lib/iugusdk/engine.rb +13 -0
- data/lib/iugusdk/locale_filter.rb +12 -0
- data/lib/iugusdk/root_tenancy_url.rb +22 -0
- data/lib/iugusdk/valid_tenancy_urls.rb +27 -0
- data/lib/iugusdk/version.rb +3 -0
- data/lib/tasks/iugusdk_tasks.rake +4 -0
- data/spec/controller_macros.rb +41 -0
- data/spec/controllers/account_controller_spec.rb +155 -0
- data/spec/controllers/account_domains_controller_spec.rb +173 -0
- data/spec/controllers/account_roles_controller_spec.rb +48 -0
- data/spec/controllers/account_settings_controller_spec.rb +42 -0
- data/spec/controllers/account_users_controller_spec.rb +145 -0
- data/spec/controllers/application_domain_controller_spec.rb +29 -0
- data/spec/controllers/invitations_controller_spec.rb +102 -0
- data/spec/controllers/profile_controller_spec.rb +125 -0
- data/spec/controllers/settings_controller_spec.rb +14 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/assets/stylesheets/default.sass +111 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/controllers/dashboard_controller.rb +8 -0
- data/spec/dummy/app/controllers/my_dummy_controller.rb +9 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/dashboard/index.html.haml +5 -0
- data/spec/dummy/app/views/dashboard/splash.html.haml +10 -0
- data/spec/dummy/app/views/layouts/application.html.erb +29 -0
- data/spec/dummy/app/views/layouts/dummy.html.erb +22 -0
- data/spec/dummy/app/views/my_dummy/index.html.haml +5 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/account_roles.yml +3 -0
- data/spec/dummy/config/application.rb +66 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +37 -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 +60 -0
- data/spec/dummy/config/environments/test.rb +40 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/iugusdk.rb +4 -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 +69 -0
- data/spec/dummy/config/social_accounts.yml +6 -0
- data/spec/dummy/db/schema.rb +95 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/tmp/cache/sass/1f198e4a81e57d6c86c6fff1f0e13592b233ebc2/prettify.cssc +0 -0
- data/spec/dummy/tmp/cache/sass/40796b6ca2cf9112b889007328d8a4c5fdc634d8/_css3.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/40796b6ca2cf9112b889007328d8a4c5fdc634d8/_support.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/589e829967f8e21bd017e2d6a46ea53360f10fe0/components.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/589e829967f8e21bd017e2d6a46ea53360f10fe0/iugu-ux.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/589e829967f8e21bd017e2d6a46ea53360f10fe0/mixins.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/589e829967f8e21bd017e2d6a46ea53360f10fe0/reset.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/589e829967f8e21bd017e2d6a46ea53360f10fe0/typography.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/589e829967f8e21bd017e2d6a46ea53360f10fe0/utilities.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/589e829967f8e21bd017e2d6a46ea53360f10fe0/variables.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_appearance.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_background-clip.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_background-origin.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_background-size.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_border-radius.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_box-shadow.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_box-sizing.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_box.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_columns.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_font-face.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_images.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_inline-block.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_opacity.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_shared.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_text-shadow.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_transform.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/7694fbc0853be2496915aae45b37e2d934ffc111/_transition.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/9da4e62a062dae83baa33f29455be2ba30cf5dce/_sprites.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/db2a23483187bf5625185da2d6f47de2a6de4989/_base.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/db2a23483187bf5625185da2d6f47de2a6de4989/_sprite-img.scssc +0 -0
- data/spec/dummy/tmp/cache/sass/e5be18dde92936a4632e65289dad5788ed73dd60/base_settings.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/e5be18dde92936a4632e65289dad5788ed73dd60/settings.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/e764476e9a85279ad82622591ce49983ed21c149/application.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/e764476e9a85279ad82622591ce49983ed21c149/base_settings.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/e764476e9a85279ad82622591ce49983ed21c149/default.sassc +0 -0
- data/spec/dummy/tmp/cache/sass/eab9c0816f626278a6731ce2928de6fdbe99322b/_hacks.scssc +0 -0
- data/spec/dummy/tmp/restart.txt +0 -0
- data/spec/fabricators/account_domain_fabricator.rb +4 -0
- data/spec/fabricators/account_fabricator.rb +4 -0
- data/spec/fabricators/account_role_fabricator.rb +3 -0
- data/spec/fabricators/account_user_fabricator.rb +4 -0
- data/spec/fabricators/social_account_fabricator.rb +10 -0
- data/spec/fabricators/user_fabricator.rb +10 -0
- data/spec/fabricators/user_invitation_fabricator.rb +4 -0
- data/spec/mailers/iugu_mailer_spec.rb +22 -0
- data/spec/models/account_domain_spec.rb +111 -0
- data/spec/models/account_role_spec.rb +24 -0
- data/spec/models/account_spec.rb +155 -0
- data/spec/models/account_user_spec.rb +158 -0
- data/spec/models/social_account_spec.rb +36 -0
- data/spec/models/user_invitation_spec.rb +92 -0
- data/spec/models/user_spec.rb +187 -0
- data/spec/requests/account_domain_spec.rb +77 -0
- data/spec/requests/account_roles_spec.rb +45 -0
- data/spec/requests/account_spec.rb +97 -0
- data/spec/requests/account_users_spec.rb +129 -0
- data/spec/requests/omniauth_spec.rb +79 -0
- data/spec/requests/settings_spec.rb +53 -0
- data/spec/requests/user_invitation_spec.rb +40 -0
- data/spec/requests/user_spec.rb +34 -0
- data/spec/spec_helper.rb +116 -0
- data/spec/validators/email_validator_spec.rb +21 -0
- metadata +729 -0
@@ -0,0 +1,125 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Iugu::ProfileController do
|
4
|
+
|
5
|
+
context "index" do
|
6
|
+
|
7
|
+
login_as_user
|
8
|
+
|
9
|
+
before do
|
10
|
+
get :index
|
11
|
+
end
|
12
|
+
|
13
|
+
it { response.should render_template 'iugu/settings/profile' }
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
context "update" do
|
18
|
+
|
19
|
+
login_as_user
|
20
|
+
|
21
|
+
before do
|
22
|
+
post :update, :user => { :name => "Testname" }
|
23
|
+
end
|
24
|
+
|
25
|
+
it { response.should render_template 'iugu/settings/profile' }
|
26
|
+
|
27
|
+
context "with errors" do
|
28
|
+
login_as_user
|
29
|
+
|
30
|
+
before do
|
31
|
+
post :update, :user => { :password => "aaaaaaaaaaaaaa", :password_confirmation => "bbbbbbbbbbbbbb" }
|
32
|
+
end
|
33
|
+
|
34
|
+
it { flash[:error].should_not be_nil }
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
context "destroy" do
|
41
|
+
login_as_user
|
42
|
+
|
43
|
+
before(:each) do
|
44
|
+
get :destroy
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'user should be destroyed' do
|
48
|
+
@user.destroying?.should be_true
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
context "cancel_destruction" do
|
54
|
+
login_as_user
|
55
|
+
|
56
|
+
before(:each) do
|
57
|
+
@user.destroy
|
58
|
+
get :cancel_destruction
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'user destruction should be canceled' do
|
62
|
+
@user.destroying?.should be_false
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
context "destroy_social" do
|
68
|
+
|
69
|
+
login_as_user
|
70
|
+
|
71
|
+
before(:each) do
|
72
|
+
@user.social_accounts << Fabricate(:social_account_without_user)
|
73
|
+
end
|
74
|
+
|
75
|
+
|
76
|
+
context "when user has email and password" do
|
77
|
+
|
78
|
+
before do
|
79
|
+
get :destroy_social, :id => @user.social_accounts.first.id
|
80
|
+
end
|
81
|
+
|
82
|
+
it { response.should redirect_to profile_settings_path }
|
83
|
+
|
84
|
+
it 'should notice OK message' do
|
85
|
+
flash.now[:social].should match I18n.t("iugu.social_unlinked")
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
|
90
|
+
context "when user has no email or password" do
|
91
|
+
|
92
|
+
before do
|
93
|
+
@user = Fabricate.build(:user_without_email)
|
94
|
+
@user.social_accounts << Fabricate(:social_account_without_user)
|
95
|
+
@user.skip_confirmation!
|
96
|
+
@user.save(:validate => false)
|
97
|
+
@user.reload
|
98
|
+
sign_in @user
|
99
|
+
get :destroy_social, :id => @user.social_accounts.first.id
|
100
|
+
end
|
101
|
+
|
102
|
+
it { response.should redirect_to profile_settings_path }
|
103
|
+
|
104
|
+
it 'should notice no email/password error' do
|
105
|
+
flash.now[:social].should match I18n.t("errors.messages.only_social_and_no_email")
|
106
|
+
end
|
107
|
+
|
108
|
+
end
|
109
|
+
|
110
|
+
context "when social_account id is wrong" do
|
111
|
+
|
112
|
+
before do
|
113
|
+
get :destroy_social, :id => 9128739127
|
114
|
+
end
|
115
|
+
|
116
|
+
it { response.should redirect_to profile_settings_path }
|
117
|
+
|
118
|
+
it 'should notice record not found' do
|
119
|
+
flash.now[:social].should match I18n.t("errors.messages.not_found")
|
120
|
+
end
|
121
|
+
|
122
|
+
end
|
123
|
+
|
124
|
+
end
|
125
|
+
end
|
data/spec/dummy/Rakefile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
3
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
4
|
+
|
5
|
+
require File.expand_path('../config/application', __FILE__)
|
6
|
+
|
7
|
+
Dummy::Application.load_tasks
|
@@ -0,0 +1,9 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
+
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
+
// the compiled file.
|
6
|
+
//
|
7
|
+
//= require jquery
|
8
|
+
//= require jquery_ujs
|
9
|
+
//= require_tree .
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
3
|
+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
|
+
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
|
+
*= require_self
|
6
|
+
*= require_tree .
|
7
|
+
*/
|
@@ -0,0 +1,111 @@
|
|
1
|
+
body,html
|
2
|
+
margin: 0px
|
3
|
+
padding: 0px
|
4
|
+
font-family: "Arial"
|
5
|
+
|
6
|
+
.container
|
7
|
+
max-width: 980px
|
8
|
+
margin-left: auto
|
9
|
+
margin-right: auto
|
10
|
+
margin-top: 20px
|
11
|
+
|
12
|
+
.wrapper
|
13
|
+
padding: 20px
|
14
|
+
|
15
|
+
|
16
|
+
h1,h2,h3,h4,h5,h6,p
|
17
|
+
margin: 0px
|
18
|
+
padding: 0px
|
19
|
+
margin-bottom: 20px
|
20
|
+
|
21
|
+
.flash
|
22
|
+
border: 1px solid #ECECEC
|
23
|
+
background: #FFFFCC
|
24
|
+
color: #000
|
25
|
+
padding: 20px
|
26
|
+
margin-bottom: 20px
|
27
|
+
margin-top: 20px
|
28
|
+
font-weight: bold
|
29
|
+
|
30
|
+
h1,h2,h3,h4,h5,h6
|
31
|
+
font-family: "Myriad Pro"
|
32
|
+
|
33
|
+
form
|
34
|
+
width: 340px
|
35
|
+
margin-left: auto
|
36
|
+
margin-right: auto
|
37
|
+
border: 1px solid #CCC
|
38
|
+
padding: 20px
|
39
|
+
|
40
|
+
form div
|
41
|
+
margin-bottom: 15px
|
42
|
+
|
43
|
+
form div label
|
44
|
+
display: block
|
45
|
+
width: 200px
|
46
|
+
margin-right: 20px
|
47
|
+
text-align: left
|
48
|
+
padding-top: 3px
|
49
|
+
|
50
|
+
form
|
51
|
+
input[type=text],input[type=password],input[type=email]
|
52
|
+
border: 1px solid #666
|
53
|
+
padding: 10px
|
54
|
+
font-size: 14px
|
55
|
+
|
56
|
+
form div .field_with_errors input
|
57
|
+
border: 1px solid #FF0000
|
58
|
+
|
59
|
+
form input[type=submit]
|
60
|
+
font-size: 20px
|
61
|
+
border: 1px solid #CCC
|
62
|
+
background: #ECECEC
|
63
|
+
padding: 10px
|
64
|
+
width: 120px
|
65
|
+
display: block
|
66
|
+
line-height: 20px
|
67
|
+
padding-top: 0px
|
68
|
+
padding-bottom: 0px
|
69
|
+
height: 40px
|
70
|
+
margin-left: auto
|
71
|
+
margin-right: auto
|
72
|
+
cursor: pointer
|
73
|
+
|
74
|
+
#error_explanation
|
75
|
+
|
76
|
+
.action-box
|
77
|
+
width: 500px
|
78
|
+
margin-left: auto
|
79
|
+
margin-right: auto
|
80
|
+
height: 80px
|
81
|
+
position: relative
|
82
|
+
|
83
|
+
#bt-login,#bt-signup
|
84
|
+
display: block
|
85
|
+
width: 220px
|
86
|
+
height: 60px
|
87
|
+
font-family: "Myriad Pro"
|
88
|
+
font-size: 26px
|
89
|
+
line-height: 60px
|
90
|
+
font-weight: bold
|
91
|
+
text-align: center
|
92
|
+
background: #ECECEC
|
93
|
+
text-decoration: none
|
94
|
+
color: #333
|
95
|
+
-webkit-border-radius: 5px
|
96
|
+
-moz-border-radius: 5px
|
97
|
+
border-radius: 5px
|
98
|
+
|
99
|
+
#bt-login
|
100
|
+
position: absolute
|
101
|
+
left: 0px
|
102
|
+
top: 0px
|
103
|
+
background: #333333
|
104
|
+
color: #FFF
|
105
|
+
|
106
|
+
#bt-signup
|
107
|
+
position: absolute
|
108
|
+
right: 0px
|
109
|
+
top: 0px
|
110
|
+
background: #006600
|
111
|
+
color: #FFFFFF
|
@@ -0,0 +1,10 @@
|
|
1
|
+
%h1
|
2
|
+
Welcome to Dummy
|
3
|
+
|
4
|
+
%h3
|
5
|
+
Find why Dummy Application is helping everyone live better!
|
6
|
+
|
7
|
+
.action-box
|
8
|
+
= link_to 'Login', new_user_session_path, :id => "bt-login"
|
9
|
+
%span.or or
|
10
|
+
= link_to 'Create Account', new_user_registration_path, :id => "bt-signup"
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<%= stylesheet_link_tag "application" %>
|
6
|
+
<%= javascript_include_tag "application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body class="<%= body_classes.join(' ') %>">
|
10
|
+
|
11
|
+
<div class="container">
|
12
|
+
<div class="wrapper">
|
13
|
+
<% if user_signed_in? %>
|
14
|
+
You are signed in as <%= current_user.email %>
|
15
|
+
<%= link_to "Settings", settings_path %> | <%= link_to "Sign out", destroy_user_session_path, :method => :delete %>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<h4><%= link_to "Dummy", root_path %></h4>
|
19
|
+
|
20
|
+
<% flash.each do |name, msg| %>
|
21
|
+
<%= content_tag :div, msg, :id => "flash_#{name}", :class => "flash" if msg.is_a?(String) %>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<%= yield %>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
</body>
|
29
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>My Dummy</title>
|
5
|
+
<%= stylesheet_link_tag "application" %>
|
6
|
+
<%= javascript_include_tag "application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body class="<%= body_classes.join(' ') %>">
|
10
|
+
|
11
|
+
<div class="container">
|
12
|
+
<div class="wrapper">
|
13
|
+
<% flash.each do |name, msg| %>
|
14
|
+
<%= content_tag :div, msg, :id => "flash_#{name}", :class => "flash" if msg.is_a?(String) %>
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<%= yield %>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
Bundler.require
|
6
|
+
require "iugusdk"
|
7
|
+
require "fabrication"
|
8
|
+
|
9
|
+
module Dummy
|
10
|
+
class Application < Rails::Application
|
11
|
+
# Settings in config/environments/* take precedence over those specified here.
|
12
|
+
# Application configuration should go into files in config/initializers
|
13
|
+
# -- all .rb files in that directory are automatically loaded.
|
14
|
+
|
15
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
16
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
17
|
+
|
18
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
19
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
20
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
21
|
+
|
22
|
+
# Activate observers that should always be running.
|
23
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
24
|
+
|
25
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
26
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
27
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
28
|
+
|
29
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
30
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
31
|
+
# config.i18n.default_locale = :de
|
32
|
+
|
33
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
34
|
+
config.encoding = "utf-8"
|
35
|
+
|
36
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
37
|
+
config.filter_parameters += [:password]
|
38
|
+
|
39
|
+
# Enable the asset pipeline
|
40
|
+
config.assets.enabled = true
|
41
|
+
|
42
|
+
# Version of your assets, change this if you want to expire all your assets
|
43
|
+
config.assets.version = '1.0'
|
44
|
+
|
45
|
+
# Fabrication
|
46
|
+
config.generators do |g|
|
47
|
+
g.test_framework :rspec, :fixture => true
|
48
|
+
g.fixture_replacement :fabrication, :dir => "spec/fabricators"
|
49
|
+
end
|
50
|
+
|
51
|
+
# Config Mailer
|
52
|
+
|
53
|
+
config.action_mailer.smtp_settings = {
|
54
|
+
address: "smtp.gmail.com",
|
55
|
+
port: 587,
|
56
|
+
domain: "iugu.com.br",
|
57
|
+
user_name: "envio@iugu.com.br",
|
58
|
+
password: "envioiugu",
|
59
|
+
authentication: :plain,
|
60
|
+
enable_starttls_auto: true
|
61
|
+
}
|
62
|
+
|
63
|
+
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|