summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2014-04-17 10:12:05 +0200
committerazul <azul@riseup.net>2014-04-17 10:12:05 +0200
commit3513ad74f950b113af1ba1e3d06bc6a55c48fde5 (patch)
treedb49ebd4428053d5c8d720275b77594a531a1ad1
parentcb6442c344d6bdaf52c3878b2de2fcf4d85f2648 (diff)
parent3d3688647fab7049e5b531c45b85c1e46a1d528f (diff)
Merge pull request #146 from azul/refactor/engines
Refactor/engines
-rw-r--r--.gitmodules4
-rw-r--r--CUSTOM.md4
-rw-r--r--DEVELOP.md46
-rw-r--r--Gemfile81
-rw-r--r--Gemfile.lock41
-rw-r--r--app/assets/images/leap_web_users/.gitkeep (renamed from certs/app/assets/images/leap_web_certs/.gitkeep)0
-rw-r--r--app/assets/javascripts/application.js1
-rw-r--r--app/assets/javascripts/leap.js (renamed from core/app/assets/javascripts/leap.js)0
-rw-r--r--app/assets/javascripts/platform.js (renamed from core/app/assets/javascripts/platform.js)0
m---------app/assets/javascripts/srp (renamed from users/app/assets/javascripts/srp)0
-rw-r--r--app/assets/javascripts/users.js (renamed from users/app/assets/javascripts/users.js)0
-rw-r--r--app/assets/stylesheets/leap_web_users/.gitkeep (renamed from certs/app/assets/javascripts/leap_web_certs/.gitkeep)0
-rw-r--r--app/controllers/.gitkeep (renamed from certs/app/assets/stylesheets/leap_web_certs/.gitkeep)0
-rw-r--r--app/controllers/account_settings_controller.rb (renamed from users/app/controllers/account_settings_controller.rb)0
-rw-r--r--app/controllers/controller_extension/authentication.rb (renamed from users/app/controllers/controller_extension/authentication.rb)0
-rw-r--r--app/controllers/controller_extension/token_authentication.rb (renamed from users/app/controllers/controller_extension/token_authentication.rb)0
-rw-r--r--app/controllers/keys_controller.rb (renamed from users/app/controllers/keys_controller.rb)0
-rw-r--r--app/controllers/sessions_controller.rb (renamed from users/app/controllers/sessions_controller.rb)0
-rw-r--r--app/controllers/users_base_controller.rb (renamed from users/app/controllers/users_base_controller.rb)0
-rw-r--r--app/controllers/users_controller.rb (renamed from users/app/controllers/users_controller.rb)0
-rw-r--r--app/controllers/v1/certs_controller.rb (renamed from certs/app/controllers/certs_controller.rb)2
-rw-r--r--app/controllers/v1/messages_controller.rb (renamed from users/app/controllers/v1/messages_controller.rb)0
-rw-r--r--app/controllers/v1/sessions_controller.rb (renamed from users/app/controllers/v1/sessions_controller.rb)0
-rw-r--r--app/controllers/v1/users_controller.rb (renamed from users/app/controllers/v1/users_controller.rb)0
-rw-r--r--app/controllers/webfinger_controller.rb (renamed from users/app/controllers/webfinger_controller.rb)0
-rw-r--r--app/designs/message/by_user_ids_to_show.js (renamed from users/app/designs/message/by_user_ids_to_show.js)0
-rw-r--r--app/designs/message/by_user_ids_to_show_and_created_at.js (renamed from users/app/designs/message/by_user_ids_to_show_and_created_at.js)0
-rw-r--r--app/designs/user/by_created_at_and_one_month_warning_not_sent.js (renamed from users/app/designs/user/by_created_at_and_one_month_warning_not_sent.js)0
-rw-r--r--app/helpers/.gitkeep (renamed from certs/app/controllers/.gitkeep)0
-rw-r--r--app/helpers/core_helper.rb (renamed from core/app/helpers/core_helper.rb)0
-rw-r--r--app/helpers/download_helper.rb (renamed from core/app/helpers/download_helper.rb)0
-rw-r--r--app/helpers/email_aliases_helper.rb (renamed from users/app/helpers/email_aliases_helper.rb)0
-rw-r--r--app/helpers/navigation_helper.rb (renamed from core/app/helpers/navigation_helper.rb)0
-rw-r--r--app/helpers/sessions_helper.rb (renamed from users/app/helpers/sessions_helper.rb)0
-rw-r--r--app/helpers/users_helper.rb (renamed from users/app/helpers/users_helper.rb)0
-rw-r--r--app/models/account.rb (renamed from users/app/models/account.rb)0
-rw-r--r--app/models/client_certificate.rb (renamed from certs/app/models/client_certificate.rb)0
-rw-r--r--app/models/email.rb (renamed from users/app/models/email.rb)0
-rw-r--r--app/models/identity.rb (renamed from users/app/models/identity.rb)0
-rw-r--r--app/models/local_email.rb (renamed from users/app/models/local_email.rb)0
-rw-r--r--app/models/login_format_validation.rb (renamed from users/app/models/login_format_validation.rb)0
-rw-r--r--app/models/message.rb (renamed from users/app/models/message.rb)0
-rw-r--r--app/models/pgp_key.rb (renamed from users/app/models/pgp_key.rb)0
-rw-r--r--app/models/service_level.rb (renamed from users/app/models/service_level.rb)0
-rw-r--r--app/models/session.rb (renamed from users/app/models/session.rb)0
-rw-r--r--app/models/token.rb (renamed from users/app/models/token.rb)0
-rw-r--r--app/models/unauthenticated_user.rb (renamed from users/app/models/unauthenticated_user.rb)0
-rw-r--r--app/models/user.rb (renamed from users/app/models/user.rb)0
-rw-r--r--app/views/.gitkeep (renamed from certs/app/helpers/.gitkeep)0
-rw-r--r--app/views/common/_download_for_os.html.haml (renamed from core/app/views/common/_download_for_os.html.haml)0
-rw-r--r--app/views/common/_home_page_buttons.html.haml (renamed from core/app/views/common/_home_page_buttons.html.haml)0
-rw-r--r--app/views/emails/_email.html.haml (renamed from users/app/views/emails/_email.html.haml)0
-rw-r--r--app/views/kaminari/_first_page.html.haml (renamed from core/app/views/kaminari/_first_page.html.haml)0
-rw-r--r--app/views/kaminari/_gap.html.haml (renamed from core/app/views/kaminari/_gap.html.haml)0
-rw-r--r--app/views/kaminari/_last_page.html.haml (renamed from core/app/views/kaminari/_last_page.html.haml)0
-rw-r--r--app/views/kaminari/_next_page.html.haml (renamed from core/app/views/kaminari/_next_page.html.haml)0
-rw-r--r--app/views/kaminari/_page.html.haml (renamed from core/app/views/kaminari/_page.html.haml)0
-rw-r--r--app/views/kaminari/_paginator.html.haml (renamed from core/app/views/kaminari/_paginator.html.haml)0
-rw-r--r--app/views/kaminari/_prev_page.html.haml (renamed from core/app/views/kaminari/_prev_page.html.haml)0
-rw-r--r--app/views/sessions/new.html.haml (renamed from users/app/views/sessions/new.html.haml)0
-rw-r--r--app/views/sessions/new.json.erb (renamed from users/app/views/sessions/new.json.erb)0
-rw-r--r--app/views/users/_change_password.html.haml (renamed from users/app/views/users/_change_password.html.haml)0
-rw-r--r--app/views/users/_change_pgp_key.html.haml (renamed from users/app/views/users/_change_pgp_key.html.haml)0
-rw-r--r--app/views/users/_change_service_level.html.haml (renamed from users/app/views/users/_change_service_level.html.haml)0
-rw-r--r--app/views/users/_destroy_account.html.haml (renamed from users/app/views/users/_destroy_account.html.haml)0
-rw-r--r--app/views/users/_edit.html.haml (renamed from users/app/views/users/_edit.html.haml)0
-rw-r--r--app/views/users/_user.html.haml (renamed from users/app/views/users/_user.html.haml)0
-rw-r--r--app/views/users/_warnings.html.haml (renamed from users/app/views/users/_warnings.html.haml)0
-rw-r--r--app/views/users/edit.html.haml (renamed from users/app/views/users/edit.html.haml)0
-rw-r--r--app/views/users/index.html.haml (renamed from users/app/views/users/index.html.haml)0
-rw-r--r--app/views/users/new.html.haml (renamed from users/app/views/users/new.html.haml)0
-rw-r--r--app/views/users/show.html.haml (renamed from users/app/views/users/show.html.haml)0
-rw-r--r--app/views/v1/sessions/new.json.erb (renamed from users/app/views/v1/sessions/new.json.erb)0
-rw-r--r--app/views/webfinger/host_meta.xml.erb (renamed from users/app/views/webfinger/host_meta.xml.erb)0
-rw-r--r--app/views/webfinger/search.xml.erb (renamed from users/app/views/webfinger/search.xml.erb)0
-rw-r--r--certs/Gemfile14
-rw-r--r--certs/Rakefile44
-rw-r--r--certs/Readme.md9
-rw-r--r--certs/app/helpers/certs_helper.rb2
-rw-r--r--certs/app/mailers/.gitkeep0
-rw-r--r--certs/app/models/.gitkeep0
-rw-r--r--certs/app/views/.gitkeep0
-rw-r--r--certs/config/locales/en.yml2
-rw-r--r--certs/config/routes.rb5
-rw-r--r--certs/leap_web_certs.gemspec21
-rw-r--r--certs/lib/leap_web_certs.rb4
-rw-r--r--certs/lib/leap_web_certs/engine.rb7
-rw-r--r--certs/lib/tasks/leap_web_certs_tasks.rake4
-rwxr-xr-xcerts/script/rails8
-rw-r--r--certs/test/leap_web_certs_test.rb7
-rw-r--r--certs/test/test_helper.rb10
-rw-r--r--common_dependencies.rb22
-rw-r--r--config/defaults.yml4
-rw-r--r--config/initializers/add_controller_methods.rb (renamed from users/config/initializers/add_controller_methods.rb)0
-rw-r--r--config/initializers/couchrest_model.rb (renamed from core/config/initializers/couchrest_model.rb)2
-rw-r--r--config/initializers/error_constants.rb (renamed from users/config/initializers/error_constants.rb)2
-rw-r--r--config/initializers/simple_form.rb (renamed from core/config/initializers/simple_form.rb)0
-rw-r--r--config/initializers/simple_form_bootstrap.rb (renamed from core/config/initializers/simple_form_bootstrap.rb)0
-rw-r--r--config/initializers/validations.rb (renamed from core/config/initializers/validations.rb)0
-rw-r--r--config/initializers/warden.rb (renamed from users/config/initializers/warden.rb)3
-rw-r--r--config/initializers/webfinger.rb1
-rw-r--r--config/locales/en.yml42
-rw-r--r--config/locales/simple_form.en.yml (renamed from core/config/locales/simple_form.en.yml)0
-rw-r--r--config/locales/users.en.yml (renamed from users/config/locales/en.yml)0
-rw-r--r--config/routes.rb28
-rw-r--r--core/Gemfile17
-rw-r--r--core/Rakefile44
-rw-r--r--core/Readme.md6
-rw-r--r--core/config/initializers/backtrace_silencers.rb7
-rw-r--r--core/config/initializers/inflections.rb15
-rw-r--r--core/config/initializers/mime_types.rb5
-rw-r--r--core/config/initializers/wrap_parameters.rb10
-rw-r--r--core/config/locales/en.yml41
-rw-r--r--core/config/routes.rb2
-rw-r--r--core/leap_web_core.gemspec25
-rw-r--r--core/lib/extensions/testing.rb48
-rw-r--r--core/lib/leap_web_core.rb14
-rw-r--r--core/lib/leap_web_core/dependencies.rb40
-rw-r--r--core/lib/leap_web_core/engine.rb9
-rw-r--r--core/lib/leap_web_core/ui_dependencies.rb11
-rwxr-xr-xcore/script/rails8
-rw-r--r--engines/billing/Gemfile (renamed from billing/Gemfile)0
-rw-r--r--engines/billing/README.md (renamed from billing/README.md)0
-rw-r--r--engines/billing/Rakefile (renamed from billing/Rakefile)0
-rw-r--r--engines/billing/app/controllers/billing_admin_controller.rb (renamed from billing/app/controllers/billing_admin_controller.rb)0
-rw-r--r--engines/billing/app/controllers/billing_base_controller.rb (renamed from billing/app/controllers/billing_base_controller.rb)0
-rw-r--r--engines/billing/app/controllers/credit_card_info_controller.rb (renamed from billing/app/controllers/credit_card_info_controller.rb)0
-rw-r--r--engines/billing/app/controllers/customer_controller.rb (renamed from billing/app/controllers/customer_controller.rb)0
-rw-r--r--engines/billing/app/controllers/payments_controller.rb (renamed from billing/app/controllers/payments_controller.rb)0
-rw-r--r--engines/billing/app/controllers/subscriptions_controller.rb (renamed from billing/app/controllers/subscriptions_controller.rb)0
-rw-r--r--engines/billing/app/helpers/billing_helper.rb (renamed from billing/app/helpers/billing_helper.rb)0
-rw-r--r--engines/billing/app/helpers/braintree_form_helper.rb (renamed from billing/app/helpers/braintree_form_helper.rb)0
-rw-r--r--engines/billing/app/helpers/braintree_helper.rb (renamed from billing/app/helpers/braintree_helper.rb)0
-rw-r--r--engines/billing/app/models/customer.rb (renamed from billing/app/models/customer.rb)0
-rw-r--r--engines/billing/app/views/billing_admin/show.html.haml (renamed from billing/app/views/billing_admin/show.html.haml)0
-rw-r--r--engines/billing/app/views/credit_card_info/confirm.html.haml (renamed from billing/app/views/credit_card_info/confirm.html.haml)0
-rw-r--r--engines/billing/app/views/credit_card_info/edit.html.haml (renamed from billing/app/views/credit_card_info/edit.html.haml)0
-rw-r--r--engines/billing/app/views/customer/_customer_data.html.haml (renamed from billing/app/views/customer/_customer_data.html.haml)0
-rw-r--r--engines/billing/app/views/customer/_transaction.html.haml (renamed from billing/app/views/customer/_transaction.html.haml)0
-rw-r--r--engines/billing/app/views/customer/confirm.html.haml (renamed from billing/app/views/customer/confirm.html.haml)0
-rw-r--r--engines/billing/app/views/customer/edit.html.haml (renamed from billing/app/views/customer/edit.html.haml)0
-rw-r--r--engines/billing/app/views/customer/new.html.haml (renamed from billing/app/views/customer/new.html.haml)0
-rw-r--r--engines/billing/app/views/customer/show.html.haml (renamed from billing/app/views/customer/show.html.haml)0
-rw-r--r--engines/billing/app/views/payments/_non_customer_fields.html.haml (renamed from billing/app/views/payments/_non_customer_fields.html.haml)0
-rw-r--r--engines/billing/app/views/payments/_transaction_details.html.haml (renamed from billing/app/views/payments/_transaction_details.html.haml)0
-rw-r--r--engines/billing/app/views/payments/confirm.html.haml (renamed from billing/app/views/payments/confirm.html.haml)0
-rw-r--r--engines/billing/app/views/payments/index.html.haml (renamed from billing/app/views/payments/index.html.haml)0
-rw-r--r--engines/billing/app/views/payments/new.html.haml (renamed from billing/app/views/payments/new.html.haml)0
-rw-r--r--engines/billing/app/views/subscriptions/_subscription_details.html.haml (renamed from billing/app/views/subscriptions/_subscription_details.html.haml)0
-rw-r--r--engines/billing/app/views/subscriptions/create.html.haml (renamed from billing/app/views/subscriptions/create.html.haml)0
-rw-r--r--engines/billing/app/views/subscriptions/destroy.html.haml (renamed from billing/app/views/subscriptions/destroy.html.haml)0
-rw-r--r--engines/billing/app/views/subscriptions/index.html.haml (renamed from billing/app/views/subscriptions/index.html.haml)0
-rw-r--r--engines/billing/app/views/subscriptions/new.html.haml (renamed from billing/app/views/subscriptions/new.html.haml)0
-rw-r--r--engines/billing/app/views/subscriptions/show.html.haml (renamed from billing/app/views/subscriptions/show.html.haml)0
-rw-r--r--engines/billing/config/initializers/braintree.rb (renamed from billing/config/initializers/braintree.rb)8
-rw-r--r--engines/billing/config/locales/en.yml (renamed from billing/config/locales/en.yml)0
-rw-r--r--engines/billing/config/routes.rb (renamed from billing/config/routes.rb)0
-rw-r--r--engines/billing/leap_web_billing.gemspec (renamed from billing/leap_web_billing.gemspec)5
-rw-r--r--engines/billing/lib/braintree_test_app.rb (renamed from billing/lib/braintree_test_app.rb)0
-rw-r--r--engines/billing/lib/leap_web_billing.rb (renamed from billing/lib/leap_web_billing.rb)0
-rw-r--r--engines/billing/lib/leap_web_billing/engine.rb (renamed from billing/lib/leap_web_billing/engine.rb)3
-rwxr-xr-xengines/billing/script/rails (renamed from billing/script/rails)0
-rw-r--r--engines/billing/test/broken/admin_customer_test.rb (renamed from billing/test/integration/admin_customer_test.rb)7
-rw-r--r--engines/billing/test/broken/customer_creation_test.rb (renamed from billing/test/integration/customer_creation_test.rb)7
-rw-r--r--engines/billing/test/broken/subscription_test.rb (renamed from billing/test/integration/subscription_test.rb)6
-rw-r--r--engines/billing/test/factories.rb (renamed from billing/test/factories.rb)0
-rw-r--r--engines/billing/test/functional/customer_controller_test.rb (renamed from billing/test/functional/customer_controller_test.rb)0
-rw-r--r--engines/billing/test/functional/customers_controller_test.rb (renamed from billing/test/functional/customers_controller_test.rb)0
-rw-r--r--engines/billing/test/functional/payments_controller_test.rb (renamed from billing/test/functional/payments_controller_test.rb)0
-rw-r--r--engines/billing/test/functional/subscriptions_controller_test.rb (renamed from billing/test/functional/subscriptions_controller_test.rb)0
-rw-r--r--engines/billing/test/support/braintree_integration_test.rb18
-rw-r--r--engines/billing/test/support/customer_test_helper.rb (renamed from billing/test/support/customer_test_helper.rb)0
-rw-r--r--engines/billing/test/test_helper.rb (renamed from help/test/test_helper.rb)2
-rw-r--r--engines/billing/test/unit/customer_test.rb (renamed from billing/test/unit/customer_test.rb)0
-rw-r--r--engines/billing/test/unit/customer_with_payment_info_test.rb (renamed from billing/test/unit/customer_with_payment_info_test.rb)0
-rw-r--r--engines/support/Gemfile (renamed from help/Gemfile)0
-rw-r--r--engines/support/README.md (renamed from help/README.md)0
-rw-r--r--engines/support/Rakefile (renamed from help/Rakefile)0
-rw-r--r--engines/support/app/assets/javascripts/tickets.js (renamed from help/app/assets/javascripts/tickets.js)0
-rw-r--r--engines/support/app/controllers/tickets_controller.rb (renamed from help/app/controllers/tickets_controller.rb)0
-rw-r--r--engines/support/app/designs/ticket/by_includes_post_by.js (renamed from help/app/designs/ticket/by_includes_post_by.js)0
-rw-r--r--engines/support/app/designs/ticket/by_includes_post_by_and_created_at.js (renamed from help/app/designs/ticket/by_includes_post_by_and_created_at.js)0
-rw-r--r--engines/support/app/designs/ticket/by_includes_post_by_and_is_open_and_created_at.js (renamed from help/app/designs/ticket/by_includes_post_by_and_is_open_and_created_at.js)0
-rw-r--r--engines/support/app/designs/ticket/by_includes_post_by_and_is_open_and_updated_at.js (renamed from help/app/designs/ticket/by_includes_post_by_and_is_open_and_updated_at.js)0
-rw-r--r--engines/support/app/designs/ticket/by_includes_post_by_and_updated_at.js (renamed from help/app/designs/ticket/by_includes_post_by_and_updated_at.js)0
-rw-r--r--engines/support/app/helpers/auto_tickets_path_helper.rb (renamed from help/app/helpers/auto_tickets_path_helper.rb)0
-rw-r--r--engines/support/app/helpers/tickets_helper.rb (renamed from help/app/helpers/tickets_helper.rb)0
-rw-r--r--engines/support/app/models/account_extension/tickets.rb (renamed from help/app/models/account_extension/tickets.rb)0
-rw-r--r--engines/support/app/models/ticket.rb (renamed from help/app/models/ticket.rb)0
-rw-r--r--engines/support/app/models/ticket_comment.rb (renamed from help/app/models/ticket_comment.rb)0
-rw-r--r--engines/support/app/models/ticket_selection.rb (renamed from help/app/models/ticket_selection.rb)0
-rw-r--r--engines/support/app/views/tickets/_comment.html.haml (renamed from help/app/views/tickets/_comment.html.haml)0
-rw-r--r--engines/support/app/views/tickets/_edit_form.html.haml (renamed from help/app/views/tickets/_edit_form.html.haml)0
-rw-r--r--engines/support/app/views/tickets/_new_comment_form.html.haml (renamed from help/app/views/tickets/_new_comment_form.html.haml)0
-rw-r--r--engines/support/app/views/tickets/_tabs.html.haml (renamed from help/app/views/tickets/_tabs.html.haml)0
-rw-r--r--engines/support/app/views/tickets/_ticket.html.haml (renamed from help/app/views/tickets/_ticket.html.haml)0
-rw-r--r--engines/support/app/views/tickets/index.html.haml (renamed from help/app/views/tickets/index.html.haml)0
-rw-r--r--engines/support/app/views/tickets/new.html.haml (renamed from help/app/views/tickets/new.html.haml)0
-rw-r--r--engines/support/app/views/tickets/show.html.haml (renamed from help/app/views/tickets/show.html.haml)0
-rw-r--r--engines/support/config/initializers/account_lifecycle.rb (renamed from help/config/initializers/account_lifecycle.rb)0
-rw-r--r--engines/support/config/locales/en.yml (renamed from help/config/locales/en.yml)0
-rw-r--r--engines/support/config/routes.rb (renamed from help/config/routes.rb)0
-rw-r--r--engines/support/leap_web_help.gemspec (renamed from help/leap_web_help.gemspec)7
-rw-r--r--engines/support/lib/leap_web_help.rb (renamed from help/lib/leap_web_help.rb)0
-rw-r--r--engines/support/lib/leap_web_help/engine.rb4
-rw-r--r--engines/support/lib/tasks/leap_web_help_tasks.rake (renamed from help/lib/tasks/leap_web_help_tasks.rake)0
-rwxr-xr-xengines/support/script/rails (renamed from help/script/rails)0
-rw-r--r--engines/support/test/factories.rb (renamed from help/test/factories.rb)0
-rw-r--r--engines/support/test/functional/tickets_controller_test.rb (renamed from help/test/functional/tickets_controller_test.rb)0
-rw-r--r--engines/support/test/integration/navigation_test.rb (renamed from certs/test/integration/navigation_test.rb)0
-rw-r--r--engines/support/test/leap_web_help_test.rb (renamed from help/test/leap_web_help_test.rb)0
-rw-r--r--engines/support/test/test_helper.rb (renamed from billing/test/test_helper.rb)2
-rw-r--r--engines/support/test/unit/account_extension_test.rb (renamed from help/test/unit/account_extension_test.rb)0
-rw-r--r--engines/support/test/unit/ticket_comment_test.rb (renamed from help/test/unit/ticket_comment_test.rb)0
-rw-r--r--engines/support/test/unit/ticket_test.rb (renamed from help/test/unit/ticket_test.rb)0
-rw-r--r--help/lib/leap_web_help/engine.rb8
-rw-r--r--leap_web.gemspec3
-rw-r--r--lib/extensions/couchrest.rb (renamed from core/lib/extensions/couchrest.rb)2
-rw-r--r--lib/leap_web.rb4
-rw-r--r--lib/tasks/leap_web_core_tasks.rake (renamed from core/lib/tasks/leap_web_core_tasks.rake)0
-rw-r--r--lib/tasks/leap_web_users_tasks.rake (renamed from users/lib/tasks/leap_web_users_tasks.rake)0
-rw-r--r--lib/tasks/test.rake19
-rw-r--r--lib/warden/session_serializer.rb (renamed from users/lib/warden/session_serializer.rb)0
-rw-r--r--lib/warden/strategies/secure_remote_password.rb (renamed from users/lib/warden/strategies/secure_remote_password.rb)0
-rw-r--r--lib/webfinger.rb (renamed from users/lib/webfinger.rb)0
-rw-r--r--lib/webfinger/host_meta_presenter.rb (renamed from users/lib/webfinger/host_meta_presenter.rb)0
-rw-r--r--lib/webfinger/user_presenter.rb (renamed from users/lib/webfinger/user_presenter.rb)0
-rw-r--r--test/factories.rb38
-rw-r--r--test/files/ca.crt (renamed from certs/test/files/ca.crt)0
-rw-r--r--test/files/ca.key (renamed from certs/test/files/ca.key)0
-rw-r--r--test/functional/application_controller_test.rb (renamed from users/test/functional/application_controller_test.rb)0
-rw-r--r--test/functional/helper_methods_test.rb (renamed from users/test/functional/helper_methods_test.rb)0
-rw-r--r--test/functional/keys_controller_test.rb (renamed from users/test/functional/keys_controller_test.rb)0
-rw-r--r--test/functional/sessions_controller_test.rb (renamed from users/test/functional/sessions_controller_test.rb)0
-rw-r--r--test/functional/test_helpers_test.rb (renamed from users/test/functional/test_helpers_test.rb)0
-rw-r--r--test/functional/users_controller_test.rb (renamed from users/test/functional/users_controller_test.rb)0
-rw-r--r--test/functional/v1/certs_controller_test.rb (renamed from certs/test/functional/certs_controller_test.rb)2
-rw-r--r--test/functional/v1/messages_controller_test.rb (renamed from users/test/functional/v1/messages_controller_test.rb)0
-rw-r--r--test/functional/v1/sessions_controller_test.rb (renamed from users/test/functional/v1/sessions_controller_test.rb)0
-rw-r--r--test/functional/v1/users_controller_test.rb (renamed from users/test/functional/v1/users_controller_test.rb)0
-rw-r--r--test/functional/webfinger_controller_test.rb (renamed from users/test/functional/webfinger_controller_test.rb)0
-rw-r--r--test/integration/api/Readme.md (renamed from users/test/integration/api/Readme.md)0
-rw-r--r--test/integration/api/login_test.rb (renamed from users/test/integration/api/login_test.rb)0
-rw-r--r--test/integration/api/pgp_key_test.rb (renamed from users/test/integration/api/pgp_key_test.rb)0
-rwxr-xr-xtest/integration/api/python/flow_with_srp.py (renamed from users/test/integration/api/python/flow_with_srp.py)0
-rwxr-xr-xtest/integration/api/python/login_wrong_username.py (renamed from users/test/integration/api/python/login_wrong_username.py)0
-rwxr-xr-xtest/integration/api/python/signup.py (renamed from users/test/integration/api/python/signup.py)0
-rwxr-xr-xtest/integration/api/python/signup_and_login.py (renamed from users/test/integration/api/python/signup_and_login.py)0
-rwxr-xr-xtest/integration/api/python/signup_and_login_wrong_password.py (renamed from users/test/integration/api/python/signup_and_login_wrong_password.py)0
-rwxr-xr-xtest/integration/api/python/umlauts.py (renamed from users/test/integration/api/python/umlauts.py)0
-rw-r--r--test/integration/api/signup_test.rb (renamed from users/test/integration/api/signup_test.rb)0
-rw-r--r--test/integration/api/srp_test.rb (renamed from users/test/integration/api/srp_test.rb)1
-rw-r--r--test/integration/api/update_account_test.rb (renamed from users/test/integration/api/update_account_test.rb)0
-rw-r--r--test/integration/browser/account_test.rb (renamed from users/test/integration/browser/account_test.rb)0
-rw-r--r--test/integration/browser/session_test.rb (renamed from users/test/integration/browser/session_test.rb)0
-rw-r--r--test/integration/navigation_test.rb (renamed from help/test/integration/navigation_test.rb)0
-rw-r--r--test/leap_web_users_test.rb (renamed from users/test/leap_web_users_test.rb)0
-rw-r--r--test/support/assert_responses.rb46
-rw-r--r--test/support/auth_test_helper.rb (renamed from users/test/support/auth_test_helper.rb)0
-rw-r--r--test/support/browser_integration_test.rb (renamed from core/test/support/browser_integration_test.rb)0
-rw-r--r--test/support/rack_test.rb (renamed from core/test/support/rack_test.rb)3
-rw-r--r--test/support/stub_record_helper.rb (renamed from users/test/support/stub_record_helper.rb)0
-rw-r--r--test/support/time_test_helper.rb (renamed from users/test/support/time_test_helper.rb)0
-rw-r--r--test/support/with_config_helper.rb (renamed from core/test/support/with_config_helper.rb)0
-rw-r--r--test/test_helper.rb5
-rw-r--r--test/unit/account_test.rb (renamed from users/test/unit/account_test.rb)0
-rw-r--r--test/unit/client_certificate_test.rb (renamed from certs/test/unit/client_certificate_test.rb)0
-rw-r--r--test/unit/helpers/session_helper_test.rb (renamed from users/test/unit/helpers/session_helper_test.rb)0
-rw-r--r--test/unit/helpers/users_helper_test.rb (renamed from users/test/unit/helpers/users_helper_test.rb)0
-rw-r--r--test/unit/identity_test.rb (renamed from users/test/unit/identity_test.rb)0
-rw-r--r--test/unit/local_email_test.rb (renamed from users/test/unit/local_email_test.rb)0
-rw-r--r--test/unit/token_test.rb (renamed from users/test/unit/token_test.rb)0
-rw-r--r--test/unit/unauthenticated_user_test.rb (renamed from users/test/unit/unauthenticated_user_test.rb)0
-rw-r--r--test/unit/user_test.rb (renamed from users/test/unit/user_test.rb)0
-rw-r--r--test/unit/warden_strategy_secure_remote_password_test.rb (renamed from users/test/unit/warden_strategy_secure_remote_password_test.rb)0
-rw-r--r--test/unit/webfinger/host_meta_presenter_test.rb (renamed from users/test/unit/webfinger/host_meta_presenter_test.rb)0
-rw-r--r--test/unit/webfinger/user_presenter_test.rb (renamed from users/test/unit/webfinger/user_presenter_test.rb)0
-rw-r--r--ui_dependencies.rb28
-rw-r--r--users/Gemfile15
-rw-r--r--users/Rakefile44
-rw-r--r--users/app/assets/images/leap_web_users/.gitkeep0
-rw-r--r--users/app/assets/javascripts/leap_web_users/.gitkeep0
-rw-r--r--users/app/assets/stylesheets/leap_web_users/.gitkeep0
-rw-r--r--users/app/controllers/.gitkeep0
-rw-r--r--users/app/helpers/.gitkeep0
-rw-r--r--users/app/mailers/.gitkeep0
-rw-r--r--users/app/models/.gitkeep0
-rw-r--r--users/app/views/.gitkeep0
-rw-r--r--users/config/routes.rb29
-rw-r--r--users/leap_web_users.gemspec22
-rw-r--r--users/lib/leap_web_users.rb4
-rw-r--r--users/lib/leap_web_users/engine.rb16
-rwxr-xr-xusers/script/rails8
-rw-r--r--users/test/factories.rb34
-rw-r--r--users/test/fixtures/.gitkeep0
-rw-r--r--users/test/functional/.gitkeep0
-rw-r--r--users/test/integration/.gitkeep0
-rw-r--r--users/test/integration/navigation_test.rb9
-rw-r--r--users/test/test_helper.rb9
-rw-r--r--users/test/unit/.gitkeep0
-rw-r--r--users/test/unit/email_test.rb19
301 files changed, 299 insertions, 860 deletions
diff --git a/.gitmodules b/.gitmodules
index 7884a42..0c28cd5 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,3 @@
-[submodule "users/app/assets/javascripts/srp"]
- path = users/app/assets/javascripts/srp
+[submodule "app/assets/javascripts/srp"]
+ path = app/assets/javascripts/srp
url = https://leap.se/git/srp_js
diff --git a/CUSTOM.md b/CUSTOM.md
index 8671323..53e4d88 100644
--- a/CUSTOM.md
+++ b/CUSTOM.md
@@ -9,6 +9,6 @@ See config/customization/README.md
Engines
---------------------
-Leap Web is based on Engines. All things in `app` will overwrite the default behaviour. You can either create a new rails app and include the leap_web gem or clone the leap web repository and add your customizations to the `app` directory.
+Leap Web includes some Engines. All things in `app` will overwrite the engine behaviour. You can clone the leap web repository and add your customizations to the `app` directory. Including leap_web as a gem is currently not supported. It should not require too much work though and we would be happy to include the changes required.
-If you have no use for one of the engines you can remove it from the Gemfile. Not however that your app might still need to provide some functionality for the other engines to work. For example the users engine provides `current_user` and other methods.
+If you have no use for one of the engines you can remove it from the Gemfile. Engines should really be plugins - no other engines should depend upon them. If you need functionality in different engines it should probably go into the toplevel. The 'users' engine will soon become part of the main webapp for that reason.
diff --git a/DEVELOP.md b/DEVELOP.md
index 6aeccff..0bc2031 100644
--- a/DEVELOP.md
+++ b/DEVELOP.md
@@ -5,21 +5,21 @@
Some tips on modifying the views:
* Many of the forms use [simple_form gem](https://github.com/plataformatec/simple_form)
+* We still use client_side_validations for the validation code but since it is not maintained anymore we want to drop it asap.
## Engines ##
-Leap Web consists of different Engines. They live in their own subdirectory and are included through bundler via their path. This way changes to the engines immediately affect the server as if they were in the main `app` directory.
+Leap Web contains some. They live in their own subdirectory and are included through bundler via their path. This way changes to the engines immediately affect the server as if they were in the main `app` directory.
-Currently Leap Web consists of 5 Engines:
+Currently Leap Web includes 2 Engines:
-* [core](https://github.com/leapcode/leap_web/blob/master/core) - ships some dependencies that are used accross all engines. This might be removed at some point.
-* [users](https://github.com/leapcode/leap_web/blob/master/users) - user registration and authorization
-* [certs](https://github.com/leapcode/leap_web/blob/master/certs) - Cert distribution for the EIP client
-* [help](https://github.com/leapcode/leap_web/blob/master/help) - Help ticket management
-* [billing](https://github.com/leapcode/leap_web/blob/master/billing) - Billing System
+* [support](https://github.com/leapcode/leap_web/blob/master/engines/support) - Help ticket management
+* [billing](https://github.com/leapcode/leap_web/blob/master/engines/billing) - Billing System
## Creating a new engine ##
+If you want to add functionality to the webapp but keep it easy to remove you might consider adding an engine. This only makes sense if your engine really is a plugin - so no other pieces of code depend on it.
+
### Rails plugin new ###
Create the basic tree structure for an engine using
@@ -32,28 +32,10 @@ rails plugin new ENGINE_NAME -O --full
See http://guides.rubyonrails.org/engines.html for more general info about engines.
-### Require Leap Web Core and dependencies ###
-
-Leap Web Core provides a common set of dependencies for the engines with CouchRest Model etc.
-It also comes with an optional set of UI gems like haml, sass, coffeescript, uglifier, bootstrap-sass, jquery and simple_form.
+You need to require engine specific gems in lib/my_engine/engine.rb:
-In order to use the core dependencies you need to add leap_web_core to your .gemspec:
```ruby
-# make sure LeapWeb::VERSION is available
-require File.expand_path('../../lib/leap_web/version.rb', __FILE__)
-# ...
- Gem::Specification.new do |s|
- # ...
- s.add_dependency "rails"
- s.add_dependency "leap_web_core", LeapWeb::Version
- end
-```
-
-You also need to require it before you define your engine in lib/my_engine/engine.rb:
-```ruby
-require "leap_web_core"
-# uncomment if you want the ui gems:
-# require "leap_web_core/ui_dependencies"
+require "my_dependency"
module MyEngine
class Engine < ::Rails::Engine
@@ -62,17 +44,9 @@ module MyEngine
end
```
-Some development and UI dependencies can not be loaded via leap_web_core. To make them available add the following lines to your engines Gemfile
-
-```ruby
- eval(File.read(File.dirname(__FILE__) + '/../common_dependencies.rb'))
- # uncomment if you want the ui gems:
- # eval(File.read(File.dirname(__FILE__) + '/../ui_dependencies.rb'))
-```
-
## Creating Models ##
-You can use the normal rails generators to create models. Since you required the leap_web_core gem you will be using CouchRest::Model. So your models inherit from CouchRest::Model::Base.
+You can use the normal rails generators to create models. You probably want to require couchrest_model so your models inherit from CouchRest::Model::Base.
http://www.couchrest.info/model/definition.html has some good first steps for setting up the model.
CouchRest Model behaved strangely when using a model without a design block. So make sure to define an initial view: http://www.couchrest.info/model/view_objects.html .
diff --git a/Gemfile b/Gemfile
index 1d6c432..b8b4568 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,16 +1,17 @@
source 'https://rubygems.org'
-eval(File.read(File.dirname(__FILE__) + '/common_dependencies.rb'))
-eval(File.read(File.dirname(__FILE__) + '/ui_dependencies.rb'))
-
-# EITHER fetch all of the leap_web gems in one go
-# gem 'leap_web'
-# OR use the local versions for development instead:
-gem "leap_web_core", :path => 'core'
-gem 'leap_web_users', :path => 'users'
-gem 'leap_web_certs', :path => 'certs'
-gem 'leap_web_help', :path => 'help'
-gem 'leap_web_billing', :path => 'billing'
+gem "rails", "~> 3.2.11"
+gem "couchrest", "~> 1.1.3"
+gem "couchrest_model", "~> 2.0.0"
+gem "couchrest_session_store", "~> 0.2.4"
+gem "json"
+
+# user management
+gem "ruby-srp", "~> 0.2.1"
+gem "rails_warden"
+
+gem 'leap_web_help', :path => 'engines/support'
+gem 'leap_web_billing', :path => 'engines/billing'
gem 'http_accept_language'
@@ -19,12 +20,62 @@ gem 'debugger', :platforms => :mri_19
# ruby 1.8 is not supported anymore
# gem 'ruby-debug', :platforms => :mri_18
+gem "haml", "~> 3.1.7"
+gem "bootstrap-sass", "= 2.3.2.2"
+gem "jquery-rails"
+gem "simple_form"
+gem 'client_side_validations'
+gem 'client_side_validations-simple_form'
+gem "bootswatch-rails", "~> 0.5.0"
+
+gem 'kaminari', "0.13.0" # for pagination. trying 0.13.0 as there seem to be
+ # issues with 0.14.0 when using couchrest
+
+gem 'rails-i18n' # locale files for built-in validation messages and times
+ # https://github.com/svenfuchs/rails-i18n
+ # for a list of keys:
+ # https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/en.yml
+
+gem 'rdiscount' # for rendering .md templates
+
group :test do
- gem 'fake_braintree', require: false
+
+ # integration testing
gem 'capybara', require: false
- gem 'launchy' # so save_and_open_page works in integration tests
- gem 'phantomjs-binaries'
- gem 'minitest-stub-const'
+ gem 'poltergeist' # headless js
+ gem 'launchy' # save_and_open_page
+ gem 'phantomjs-binaries' # binaries specific to the os
+
+ # moching and stubbing
+ gem 'mocha', '~> 0.13.0', :require => false
+ gem 'minitest-stub-const' # why?
+
+ # generating test data
+ gem 'factory_girl_rails' # test data factories
+ gem 'faker' # names and numbers for test data
+
+ # billing tests
+ gem 'fake_braintree', require: false
+end
+
+group :test, :development do
+ gem 'thin'
+end
+
+group :assets do
+ gem "haml-rails", "~> 0.3.4"
+ gem "sass-rails", "~> 3.2.5"
+ gem "coffee-rails", "~> 3.2.2"
+ gem "uglifier", "~> 1.2.7"
+
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
+ gem 'therubyracer', "~> 0.10.2", :platforms => :ruby
+ gem 'quiet_assets' # stops logging all the asset requests
+end
+
+
+group :production do
+ gem 'SyslogLogger', '~> 2.0'
end
# unreleased so far ... but leap_web_certs need it
diff --git a/Gemfile.lock b/Gemfile.lock
index 0c7486f..a2a1785 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -6,42 +6,15 @@ GIT
activemodel (>= 3.0.6)
PATH
- remote: billing
+ remote: engines/billing
specs:
leap_web_billing (0.5.0)
braintree
- leap_web_core (= 0.5.0)
PATH
- remote: certs
- specs:
- leap_web_certs (0.5.0)
- certificate_authority (>= 0.2.0)
- leap_web_core (= 0.5.0)
-
-PATH
- remote: core
- specs:
- leap_web_core (0.5.0)
- couchrest (~> 1.1.3)
- couchrest_model (~> 2.0.0)
- couchrest_session_store (~> 0.2.4)
- json
- rails (~> 3.2.11)
-
-PATH
- remote: help
+ remote: engines/support
specs:
leap_web_help (0.5.0)
- leap_web_core (= 0.5.0)
-
-PATH
- remote: users
- specs:
- leap_web_users (0.5.0)
- leap_web_core (= 0.5.0)
- rails_warden
- ruby-srp (~> 0.2.1)
GEM
remote: https://rubygems.org/
@@ -271,6 +244,9 @@ DEPENDENCIES
client_side_validations
client_side_validations-simple_form
coffee-rails (~> 3.2.2)
+ couchrest (~> 1.1.3)
+ couchrest_model (~> 2.0.0)
+ couchrest_session_store (~> 0.2.4)
debugger
factory_girl_rails
fake_braintree
@@ -279,20 +255,21 @@ DEPENDENCIES
haml-rails (~> 0.3.4)
http_accept_language
jquery-rails
+ json
kaminari (= 0.13.0)
launchy
leap_web_billing!
- leap_web_certs!
- leap_web_core!
leap_web_help!
- leap_web_users!
minitest-stub-const
mocha (~> 0.13.0)
phantomjs-binaries
poltergeist
quiet_assets
+ rails (~> 3.2.11)
rails-i18n
+ rails_warden
rdiscount
+ ruby-srp (~> 0.2.1)
sass-rails (~> 3.2.5)
simple_form
therubyracer (~> 0.10.2)
diff --git a/certs/app/assets/images/leap_web_certs/.gitkeep b/app/assets/images/leap_web_users/.gitkeep
index e69de29..e69de29 100644
--- a/certs/app/assets/images/leap_web_certs/.gitkeep
+++ b/app/assets/images/leap_web_users/.gitkeep
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index 03a40da..ab07e1f 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -20,4 +20,3 @@
//= require platform
//= require tickets
//= require users
-//= require_tree .
diff --git a/core/app/assets/javascripts/leap.js b/app/assets/javascripts/leap.js
index 94e602d..94e602d 100644
--- a/core/app/assets/javascripts/leap.js
+++ b/app/assets/javascripts/leap.js
diff --git a/core/app/assets/javascripts/platform.js b/app/assets/javascripts/platform.js
index 108c162..108c162 100644
--- a/core/app/assets/javascripts/platform.js
+++ b/app/assets/javascripts/platform.js
diff --git a/users/app/assets/javascripts/srp b/app/assets/javascripts/srp
-Subproject 8f33d32d40b1e21ae7fb9a92c78a275422af421
+Subproject 8f33d32d40b1e21ae7fb9a92c78a275422af421
diff --git a/users/app/assets/javascripts/users.js b/app/assets/javascripts/users.js
index 8486756..8486756 100644
--- a/users/app/assets/javascripts/users.js
+++ b/app/assets/javascripts/users.js
diff --git a/certs/app/assets/javascripts/leap_web_certs/.gitkeep b/app/assets/stylesheets/leap_web_users/.gitkeep
index e69de29..e69de29 100644
--- a/certs/app/assets/javascripts/leap_web_certs/.gitkeep
+++ b/app/assets/stylesheets/leap_web_users/.gitkeep
diff --git a/certs/app/assets/stylesheets/leap_web_certs/.gitkeep b/app/controllers/.gitkeep
index e69de29..e69de29 100644
--- a/certs/app/assets/stylesheets/leap_web_certs/.gitkeep
+++ b/app/controllers/.gitkeep
diff --git a/users/app/controllers/account_settings_controller.rb b/app/controllers/account_settings_controller.rb
index e69de29..e69de29 100644
--- a/users/app/controllers/account_settings_controller.rb
+++ b/app/controllers/account_settings_controller.rb
diff --git a/users/app/controllers/controller_extension/authentication.rb b/app/controllers/controller_extension/authentication.rb
index 03d3989..03d3989 100644
--- a/users/app/controllers/controller_extension/authentication.rb
+++ b/app/controllers/controller_extension/authentication.rb
diff --git a/users/app/controllers/controller_extension/token_authentication.rb b/app/controllers/controller_extension/token_authentication.rb
index 6e0a6ce..6e0a6ce 100644
--- a/users/app/controllers/controller_extension/token_authentication.rb
+++ b/app/controllers/controller_extension/token_authentication.rb
diff --git a/users/app/controllers/keys_controller.rb b/app/controllers/keys_controller.rb
index fb28901..fb28901 100644
--- a/users/app/controllers/keys_controller.rb
+++ b/app/controllers/keys_controller.rb
diff --git a/users/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index 8919a4d..8919a4d 100644
--- a/users/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
diff --git a/users/app/controllers/users_base_controller.rb b/app/controllers/users_base_controller.rb
index 9becf0d..9becf0d 100644
--- a/users/app/controllers/users_base_controller.rb
+++ b/app/controllers/users_base_controller.rb
diff --git a/users/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index c8e09b6..c8e09b6 100644
--- a/users/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
diff --git a/certs/app/controllers/certs_controller.rb b/app/controllers/v1/certs_controller.rb
index 82cbc44..64cfa7f 100644
--- a/certs/app/controllers/certs_controller.rb
+++ b/app/controllers/v1/certs_controller.rb
@@ -1,4 +1,4 @@
-class CertsController < ApplicationController
+class V1::CertsController < ApplicationController
before_filter :require_login, :unless => :anonymous_certs_allowed?
diff --git a/users/app/controllers/v1/messages_controller.rb b/app/controllers/v1/messages_controller.rb
index f71d0f1..f71d0f1 100644
--- a/users/app/controllers/v1/messages_controller.rb
+++ b/app/controllers/v1/messages_controller.rb
diff --git a/users/app/controllers/v1/sessions_controller.rb b/app/controllers/v1/sessions_controller.rb
index eae3a1e..eae3a1e 100644
--- a/users/app/controllers/v1/sessions_controller.rb
+++ b/app/controllers/v1/sessions_controller.rb
diff --git a/users/app/controllers/v1/users_controller.rb b/app/controllers/v1/users_controller.rb
index 8897d01..8897d01 100644
--- a/users/app/controllers/v1/users_controller.rb
+++ b/app/controllers/v1/users_controller.rb
diff --git a/users/app/controllers/webfinger_controller.rb b/app/controllers/webfinger_controller.rb
index 8872802..8872802 100644
--- a/users/app/controllers/webfinger_controller.rb
+++ b/app/controllers/webfinger_controller.rb
diff --git a/users/app/designs/message/by_user_ids_to_show.js b/app/designs/message/by_user_ids_to_show.js
index e33566b..e33566b 100644
--- a/users/app/designs/message/by_user_ids_to_show.js
+++ b/app/designs/message/by_user_ids_to_show.js
diff --git a/users/app/designs/message/by_user_ids_to_show_and_created_at.js b/app/designs/message/by_user_ids_to_show_and_created_at.js
index 54e4604..54e4604 100644
--- a/users/app/designs/message/by_user_ids_to_show_and_created_at.js
+++ b/app/designs/message/by_user_ids_to_show_and_created_at.js
diff --git a/users/app/designs/user/by_created_at_and_one_month_warning_not_sent.js b/app/designs/user/by_created_at_and_one_month_warning_not_sent.js
index 53a95de..53a95de 100644
--- a/users/app/designs/user/by_created_at_and_one_month_warning_not_sent.js
+++ b/app/designs/user/by_created_at_and_one_month_warning_not_sent.js
diff --git a/certs/app/controllers/.gitkeep b/app/helpers/.gitkeep
index e69de29..e69de29 100644
--- a/certs/app/controllers/.gitkeep
+++ b/app/helpers/.gitkeep
diff --git a/core/app/helpers/core_helper.rb b/app/helpers/core_helper.rb
index a6c7479..a6c7479 100644
--- a/core/app/helpers/core_helper.rb
+++ b/app/helpers/core_helper.rb
diff --git a/core/app/helpers/download_helper.rb b/app/helpers/download_helper.rb
index ee0fe73..ee0fe73 100644
--- a/core/app/helpers/download_helper.rb
+++ b/app/helpers/download_helper.rb
diff --git a/users/app/helpers/email_aliases_helper.rb b/app/helpers/email_aliases_helper.rb
index b56b068..b56b068 100644
--- a/users/app/helpers/email_aliases_helper.rb
+++ b/app/helpers/email_aliases_helper.rb
diff --git a/core/app/helpers/navigation_helper.rb b/app/helpers/navigation_helper.rb
index 19cb934..19cb934 100644
--- a/core/app/helpers/navigation_helper.rb
+++ b/app/helpers/navigation_helper.rb
diff --git a/users/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb
index 309f8b2..309f8b2 100644
--- a/users/app/helpers/sessions_helper.rb
+++ b/app/helpers/sessions_helper.rb
diff --git a/users/app/helpers/users_helper.rb b/app/helpers/users_helper.rb
index f56faab..f56faab 100644
--- a/users/app/helpers/users_helper.rb
+++ b/app/helpers/users_helper.rb
diff --git a/users/app/models/account.rb b/app/models/account.rb
index cf998e4..cf998e4 100644
--- a/users/app/models/account.rb
+++ b/app/models/account.rb
diff --git a/certs/app/models/client_certificate.rb b/app/models/client_certificate.rb
index 76b07a2..76b07a2 100644
--- a/certs/app/models/client_certificate.rb
+++ b/app/models/client_certificate.rb
diff --git a/users/app/models/email.rb b/app/models/email.rb
index a9a503f..a9a503f 100644
--- a/users/app/models/email.rb
+++ b/app/models/email.rb
diff --git a/users/app/models/identity.rb b/app/models/identity.rb
index 9b97b51..9b97b51 100644
--- a/users/app/models/identity.rb
+++ b/app/models/identity.rb
diff --git a/users/app/models/local_email.rb b/app/models/local_email.rb
index 2b4c65e..2b4c65e 100644
--- a/users/app/models/local_email.rb
+++ b/app/models/local_email.rb
diff --git a/users/app/models/login_format_validation.rb b/app/models/login_format_validation.rb
index c1fcf70..c1fcf70 100644
--- a/users/app/models/login_format_validation.rb
+++ b/app/models/login_format_validation.rb
diff --git a/users/app/models/message.rb b/app/models/message.rb
index 424f094..424f094 100644
--- a/users/app/models/message.rb
+++ b/app/models/message.rb
diff --git a/users/app/models/pgp_key.rb b/app/models/pgp_key.rb
index 66f8660..66f8660 100644
--- a/users/app/models/pgp_key.rb
+++ b/app/models/pgp_key.rb
diff --git a/users/app/models/service_level.rb b/app/models/service_level.rb
index 299aaf1..299aaf1 100644
--- a/users/app/models/service_level.rb
+++ b/app/models/service_level.rb
diff --git a/users/app/models/session.rb b/app/models/session.rb
index 0d7e10e..0d7e10e 100644
--- a/users/app/models/session.rb
+++ b/app/models/session.rb
diff --git a/users/app/models/token.rb b/app/models/token.rb
index 4856c31..4856c31 100644
--- a/users/app/models/token.rb
+++ b/app/models/token.rb
diff --git a/users/app/models/unauthenticated_user.rb b/app/models/unauthenticated_user.rb
index 0fc17d2..0fc17d2 100644
--- a/users/app/models/unauthenticated_user.rb
+++ b/app/models/unauthenticated_user.rb
diff --git a/users/app/models/user.rb b/app/models/user.rb
index c297ac8..c297ac8 100644
--- a/users/app/models/user.rb
+++ b/app/models/user.rb
diff --git a/certs/app/helpers/.gitkeep b/app/views/.gitkeep
index e69de29..e69de29 100644
--- a/certs/app/helpers/.gitkeep
+++ b/app/views/.gitkeep
diff --git a/core/app/views/common/_download_for_os.html.haml b/app/views/common/_download_for_os.html.haml
index 3a11d10..3a11d10 100644
--- a/core/app/views/common/_download_for_os.html.haml
+++ b/app/views/common/_download_for_os.html.haml
diff --git a/core/app/views/common/_home_page_buttons.html.haml b/app/views/common/_home_page_buttons.html.haml
index c9ea7a2..c9ea7a2 100644
--- a/core/app/views/common/_home_page_buttons.html.haml
+++ b/app/views/common/_home_page_buttons.html.haml
diff --git a/users/app/views/emails/_email.html.haml b/app/views/emails/_email.html.haml
index ea59cec..ea59cec 100644
--- a/users/app/views/emails/_email.html.haml
+++ b/app/views/emails/_email.html.haml
diff --git a/core/app/views/kaminari/_first_page.html.haml b/app/views/kaminari/_first_page.html.haml
index 34436e3..34436e3 100644
--- a/core/app/views/kaminari/_first_page.html.haml
+++ b/app/views/kaminari/_first_page.html.haml
diff --git a/core/app/views/kaminari/_gap.html.haml b/app/views/kaminari/_gap.html.haml
index 51de678..51de678 100644
--- a/core/app/views/kaminari/_gap.html.haml
+++ b/app/views/kaminari/_gap.html.haml
diff --git a/core/app/views/kaminari/_last_page.html.haml b/app/views/kaminari/_last_page.html.haml
index c90433c..c90433c 100644
--- a/core/app/views/kaminari/_last_page.html.haml
+++ b/app/views/kaminari/_last_page.html.haml
diff --git a/core/app/views/kaminari/_next_page.html.haml b/app/views/kaminari/_next_page.html.haml
index ea6cab2..ea6cab2 100644
--- a/core/app/views/kaminari/_next_page.html.haml
+++ b/app/views/kaminari/_next_page.html.haml
diff --git a/core/app/views/kaminari/_page.html.haml b/app/views/kaminari/_page.html.haml
index 2f2f142..2f2f142 100644
--- a/core/app/views/kaminari/_page.html.haml
+++ b/app/views/kaminari/_page.html.haml
diff --git a/core/app/views/kaminari/_paginator.html.haml b/app/views/kaminari/_paginator.html.haml
index 79c5b92..79c5b92 100644
--- a/core/app/views/kaminari/_paginator.html.haml
+++ b/app/views/kaminari/_paginator.html.haml
diff --git a/core/app/views/kaminari/_prev_page.html.haml b/app/views/kaminari/_prev_page.html.haml
index d274bf4..d274bf4 100644
--- a/core/app/views/kaminari/_prev_page.html.haml
+++ b/app/views/kaminari/_prev_page.html.haml
diff --git a/users/app/views/sessions/new.html.haml b/app/views/sessions/new.html.haml
index 771dc97..771dc97 100644
--- a/users/app/views/sessions/new.html.haml
+++ b/app/views/sessions/new.html.haml
diff --git a/users/app/views/sessions/new.json.erb b/app/views/sessions/new.json.erb
index 36154b8..36154b8 100644
--- a/users/app/views/sessions/new.json.erb
+++ b/app/views/sessions/new.json.erb
diff --git a/users/app/views/users/_change_password.html.haml b/app/views/users/_change_password.html.haml
index 425e3ee..425e3ee 100644
--- a/users/app/views/users/_change_password.html.haml
+++ b/app/views/users/_change_password.html.haml
diff --git a/users/app/views/users/_change_pgp_key.html.haml b/app/views/users/_change_pgp_key.html.haml
index e465125..e465125 100644
--- a/users/app/views/users/_change_pgp_key.html.haml
+++ b/app/views/users/_change_pgp_key.html.haml
diff --git a/users/app/views/users/_change_service_level.html.haml b/app/views/users/_change_service_level.html.haml
index 61e67d9..61e67d9 100644
--- a/users/app/views/users/_change_service_level.html.haml
+++ b/app/views/users/_change_service_level.html.haml
diff --git a/users/app/views/users/_destroy_account.html.haml b/app/views/users/_destroy_account.html.haml
index 445f3c4..445f3c4 100644
--- a/users/app/views/users/_destroy_account.html.haml
+++ b/app/views/users/_destroy_account.html.haml
diff --git a/users/app/views/users/_edit.html.haml b/app/views/users/_edit.html.haml
index 1d2b68a..1d2b68a 100644
--- a/users/app/views/users/_edit.html.haml
+++ b/app/views/users/_edit.html.haml
diff --git a/users/app/views/users/_user.html.haml b/app/views/users/_user.html.haml
index 583d22f..583d22f 100644
--- a/users/app/views/users/_user.html.haml
+++ b/app/views/users/_user.html.haml
diff --git a/users/app/views/users/_warnings.html.haml b/app/views/users/_warnings.html.haml
index 79ab103..79ab103 100644
--- a/users/app/views/users/_warnings.html.haml
+++ b/app/views/users/_warnings.html.haml
diff --git a/users/app/views/users/edit.html.haml b/app/views/users/edit.html.haml
index 434c025..434c025 100644
--- a/users/app/views/users/edit.html.haml
+++ b/app/views/users/edit.html.haml
diff --git a/users/app/views/users/index.html.haml b/app/views/users/index.html.haml
index fc1001e..fc1001e 100644
--- a/users/app/views/users/index.html.haml
+++ b/app/views/users/index.html.haml
diff --git a/users/app/views/users/new.html.haml b/app/views/users/new.html.haml
index aecf831..aecf831 100644
--- a/users/app/views/users/new.html.haml
+++ b/app/views/users/new.html.haml
diff --git a/users/app/views/users/show.html.haml b/app/views/users/show.html.haml
index c587017..c587017 100644
--- a/users/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
diff --git a/users/app/views/v1/sessions/new.json.erb b/app/views/v1/sessions/new.json.erb
index 36154b8..36154b8 100644
--- a/users/app/views/v1/sessions/new.json.erb
+++ b/app/views/v1/sessions/new.json.erb
diff --git a/users/app/views/webfinger/host_meta.xml.erb b/app/views/webfinger/host_meta.xml.erb
index cfcbcc0..cfcbcc0 100644
--- a/users/app/views/webfinger/host_meta.xml.erb
+++ b/app/views/webfinger/host_meta.xml.erb
diff --git a/users/app/views/webfinger/search.xml.erb b/app/views/webfinger/search.xml.erb
index 7328552..7328552 100644
--- a/users/app/views/webfinger/search.xml.erb
+++ b/app/views/webfinger/search.xml.erb
diff --git a/certs/Gemfile b/certs/Gemfile
deleted file mode 100644
index 992f236..0000000
--- a/certs/Gemfile
+++ /dev/null
@@ -1,14 +0,0 @@
-source "https://rubygems.org"
-
-eval(File.read(File.dirname(__FILE__) + '/../common_dependencies.rb'))
-
-# We require leap_web_core from here so we can use the path option.
-gem "leap_web_core", :path => '../core'
-
-# Declare your gem's dependencies in leap_web_users.gemspec.
-# Bundler will treat runtime dependencies like base dependencies, and
-# development dependencies will be added by default to the :development group.
-gemspec
-
-# To use debugger
-# gem 'ruby-debug'
diff --git a/certs/Rakefile b/certs/Rakefile
deleted file mode 100644
index 54ed86d..0000000
--- a/certs/Rakefile
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env rake
-
-require 'rake/packagetask'
-require 'rubygems/package_task'
-
-begin
- require 'bundler/setup'
-rescue LoadError
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
-end
-begin
- require 'rdoc/task'
-rescue LoadError
- require 'rdoc/rdoc'
- require 'rake/rdoctask'
- RDoc::Task = Rake::RDocTask
-end
-
-RDoc::Task.new(:rdoc) do |rdoc|
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'LeapWebCerts'
- rdoc.options << '--line-numbers'
- rdoc.rdoc_files.include('README.rdoc')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
-
-spec = eval(File.read('leap_web_certs.gemspec'))
-Gem::PackageTask.new(spec) do |p|
- p.gem_spec = spec
-end
-
-Bundler::GemHelper.install_tasks
-
-require 'rake/testtask'
-
-Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
- t.libs << 'test'
- t.pattern = 'test/**/*_test.rb'
- t.verbose = false
-end
-
-
-task :default => :test
diff --git a/certs/Readme.md b/certs/Readme.md
deleted file mode 100644
index 4ea8d9d..0000000
--- a/certs/Readme.md
+++ /dev/null
@@ -1,9 +0,0 @@
-LeapWebCerts
-=========
-
-
-Configuration
--------------
-
-
-Currently LeapWebCerts falls back to handing out a cert in /config/cert if the cert pool is empty. You need to add that file in the application that includes this engine.
diff --git a/certs/app/helpers/certs_helper.rb b/certs/app/helpers/certs_helper.rb
deleted file mode 100644
index 94e76b8..0000000
--- a/certs/app/helpers/certs_helper.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-module CertsHelper
-end
diff --git a/certs/app/mailers/.gitkeep b/certs/app/mailers/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/certs/app/mailers/.gitkeep
+++ /dev/null
diff --git a/certs/app/models/.gitkeep b/certs/app/models/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/certs/app/models/.gitkeep
+++ /dev/null
diff --git a/certs/app/views/.gitkeep b/certs/app/views/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/certs/app/views/.gitkeep
+++ /dev/null
diff --git a/certs/config/locales/en.yml b/certs/config/locales/en.yml
deleted file mode 100644
index 18e4f47..0000000
--- a/certs/config/locales/en.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-en:
- cert_pool_empty: "Sorry the Cert pool is empty, please check back later."
diff --git a/certs/config/routes.rb b/certs/config/routes.rb
deleted file mode 100644
index cb97757..0000000
--- a/certs/config/routes.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-Rails.application.routes.draw do
- scope '/1' do
- resource :cert, :only => [:show]
- end
-end
diff --git a/certs/leap_web_certs.gemspec b/certs/leap_web_certs.gemspec
deleted file mode 100644
index 21be09d..0000000
--- a/certs/leap_web_certs.gemspec
+++ /dev/null
@@ -1,21 +0,0 @@
-$:.push File.expand_path("../lib", __FILE__)
-
-require File.expand_path('../../lib/leap_web/version.rb', __FILE__)
-
-# Describe your gem and declare its dependencies:
-Gem::Specification.new do |s|
- s.name = "leap_web_certs"
- s.version = LeapWeb::VERSION
- s.authors = ["Azul"]
- s.email = ["azul@leap.se"]
- s.homepage = "http://www.leap.se"
- s.summary = "Cert distribution for the leap platform"
- s.description = "This plugin for the leap platform distributes certs for the EIP client. It fetches the certs from a pool in CouchDB that is filled by leap-ca."
-
- s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile", "Readme.md"]
- s.test_files = Dir["test/**/*"]
-
- s.add_dependency "leap_web_core", LeapWeb::VERSION
- s.add_dependency "certificate_authority", [">= 0.2.0"]
-
-end
diff --git a/certs/lib/leap_web_certs.rb b/certs/lib/leap_web_certs.rb
deleted file mode 100644
index beb683d..0000000
--- a/certs/lib/leap_web_certs.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require "leap_web_certs/engine"
-
-module LeapWebCerts
-end
diff --git a/certs/lib/leap_web_certs/engine.rb b/certs/lib/leap_web_certs/engine.rb
deleted file mode 100644
index 3c8948a..0000000
--- a/certs/lib/leap_web_certs/engine.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require "leap_web_core"
-
-module LeapWebCerts
- class Engine < ::Rails::Engine
-
- end
-end
diff --git a/certs/lib/tasks/leap_web_certs_tasks.rake b/certs/lib/tasks/leap_web_certs_tasks.rake
deleted file mode 100644
index e8fb7ff..0000000
--- a/certs/lib/tasks/leap_web_certs_tasks.rake
+++ /dev/null
@@ -1,4 +0,0 @@
-# desc "Explaining what the task does"
-# task :leap_web_certs do
-# # Task goes here
-# end
diff --git a/certs/script/rails b/certs/script/rails
deleted file mode 100755
index 616d3c9..0000000
--- a/certs/script/rails
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env ruby1.8
-# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
-
-ENGINE_ROOT = File.expand_path('../..', __FILE__)
-ENGINE_PATH = File.expand_path('../../lib/leap_web_certs/engine', __FILE__)
-
-require 'rails/all'
-require 'rails/engine/commands'
diff --git a/certs/test/leap_web_certs_test.rb b/certs/test/leap_web_certs_test.rb
deleted file mode 100644
index ee2058b..0000000
--- a/certs/test/leap_web_certs_test.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class LeapWebCertsTest < ActiveSupport::TestCase
- test "truth" do
- assert_kind_of Module, LeapWebCerts
- end
-end
diff --git a/certs/test/test_helper.rb b/certs/test/test_helper.rb
deleted file mode 100644
index f6b4eb8..0000000
--- a/certs/test/test_helper.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-ENV["RAILS_ENV"] = "test"
-require File.expand_path('../../../test/dummy/config/environment', __FILE__)
-require 'rails/test_help'
-require 'mocha/setup'
-
-Rails.backtrace_cleaner.remove_silencers!
-
-# Load support files
-Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
-
diff --git a/common_dependencies.rb b/common_dependencies.rb
deleted file mode 100644
index 2225613..0000000
--- a/common_dependencies.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-group :test do
- # moching and stubing
- gem 'mocha', '~> 0.13.0', :require => false
- # integration testing
- gem 'capybara'
- # headless js integration testing
- gem 'poltergeist'
- # required for save_and_open_page in integration tests
- # gem 'launchy'
- gem 'fake_braintree' #depends on rspec?
- gem 'faker'
- gem 'factory_girl_rails'
-end
-
-group :test, :development do
- gem 'thin'
- gem 'quiet_assets'
-end
-
-group :production do
- gem 'SyslogLogger', '~> 2.0'
-end
diff --git a/config/defaults.yml b/config/defaults.yml
index cb18795..e7d0f5e 100644
--- a/config/defaults.yml
+++ b/config/defaults.yml
@@ -1,6 +1,6 @@
dev_ca: &dev_ca
- client_ca_key: "./certs/test/files/ca.key"
- client_ca_cert: "./certs/test/files/ca.crt"
+ client_ca_key: "./test/files/ca.key"
+ client_ca_cert: "./test/files/ca.crt"
ca_key_password: nil
cert_options: &cert_options
diff --git a/users/config/initializers/add_controller_methods.rb b/config/initializers/add_controller_methods.rb
index f572ecb..f572ecb 100644
--- a/users/config/initializers/add_controller_methods.rb
+++ b/config/initializers/add_controller_methods.rb
diff --git a/core/config/initializers/couchrest_model.rb b/config/initializers/couchrest_model.rb
index ce4f41a..1a3e921 100644
--- a/core/config/initializers/couchrest_model.rb
+++ b/config/initializers/couchrest_model.rb
@@ -1,3 +1,5 @@
+require 'extensions/couchrest'
+
CouchRest::Model::Base.configure do |config|
config.auto_update_design_doc = false
end
diff --git a/users/config/initializers/error_constants.rb b/config/initializers/error_constants.rb
index d4a0f52..fdd3624 100644
--- a/users/config/initializers/error_constants.rb
+++ b/config/initializers/error_constants.rb
@@ -1 +1,3 @@
+require 'ruby-srp'
+
WRONG_PASSWORD = SRP::WrongPassword
diff --git a/core/config/initializers/simple_form.rb b/config/initializers/simple_form.rb
index e3f8d09..e3f8d09 100644
--- a/core/config/initializers/simple_form.rb
+++ b/config/initializers/simple_form.rb
diff --git a/core/config/initializers/simple_form_bootstrap.rb b/config/initializers/simple_form_bootstrap.rb
index c949f5e..c949f5e 100644
--- a/core/config/initializers/simple_form_bootstrap.rb
+++ b/config/initializers/simple_form_bootstrap.rb
diff --git a/core/config/initializers/validations.rb b/config/initializers/validations.rb
index e8acfbe..e8acfbe 100644
--- a/core/config/initializers/validations.rb
+++ b/config/initializers/validations.rb
diff --git a/users/config/initializers/warden.rb b/config/initializers/warden.rb
index 45feb6c..22892b3 100644
--- a/users/config/initializers/warden.rb
+++ b/config/initializers/warden.rb
@@ -1,3 +1,6 @@
+require "warden/session_serializer"
+require "warden/strategies/secure_remote_password"
+
Rails.configuration.middleware.use RailsWarden::Manager do |config|
config.default_strategies :secure_remote_password
config.failure_app = SessionsController
diff --git a/config/initializers/webfinger.rb b/config/initializers/webfinger.rb
new file mode 100644
index 0000000..197062c
--- /dev/null
+++ b/config/initializers/webfinger.rb
@@ -0,0 +1 @@
+require 'webfinger'
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 96c47ca..ac154d6 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -3,4 +3,44 @@ en:
terms_of_service: Terms of Service
pricing: Pricing
about: About Us
- contact: Contact \ No newline at end of file
+ contact: Contact
+ no_such_thing: "No such %{thing}."
+ thing_was_successfully_created: "%{thing} was successfully created."
+ create_thing: "Create %{thing}"
+
+ overview: "Overview"
+ user_control_panel: "user control panel"
+
+ created: "Created"
+ created_by_on: "Created by %{user} on %{time}"
+ updated: "Updated"
+
+ none: "None"
+ unknown: "Unknown"
+ admin: "Admin"
+ anonymous: "Anonymous"
+ save: "Save"
+ add: "Add"
+ remove: "Remove"
+ changes_saved: "Changes saved successfully."
+ are_you_sure: "Are you sure? This change cannot be undone."
+
+ download_client: "Download Bitmask"
+ client_info: "The Bitmask application allows you to use %{provider} services."
+ all_downloads_info: "It is available for %{clients}."
+ other_downloads_info: "Bitmask is also available for %{clients}."
+ login_info: "Log in to change your account settings, create support tickets, and manage payments."
+ signup_info: "Sign up for a new user account via this website (it is better if you use the Bitmask application to sign up, but this website works too)."
+ welcome: "Welcome to %{provider}."
+ get_help: "Get Help"
+ help_info: "Can't login? Create a new support ticket anonymously."
+ example_email: 'user@domain.org'
+ os:
+ linux32: "Linux (32 bit)"
+ linux64: "Linux (64 bit)"
+ linux: "GNU/Linux"
+ windows: "Windows"
+ android: "Android"
+ osx: "Mac OS"
+ other: "(not available for your OS)"
+
diff --git a/core/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml
index 0df11fe..0df11fe 100644
--- a/core/config/locales/simple_form.en.yml
+++ b/config/locales/simple_form.en.yml
diff --git a/users/config/locales/en.yml b/config/locales/users.en.yml
index ed6653a..ed6653a 100644
--- a/users/config/locales/en.yml
+++ b/config/locales/users.en.yml
diff --git a/config/routes.rb b/config/routes.rb
index f8bb8fb..b930bd1 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -16,4 +16,32 @@ LeapWeb::Application.routes.draw do
end
get '/provider.json' => 'static_config#provider'
+
+ namespace "api", { module: "v1",
+ path: "/1/",
+ defaults: {format: 'json'} } do
+ resources :sessions, :only => [:new, :create, :update]
+ delete "logout" => "sessions#destroy", :as => "logout"
+ resources :users, :only => [:create, :update, :destroy, :index]
+ resources :messages, :only => [:index, :update]
+ resource :cert, :only => [:show]
+ end
+
+ scope "(:locale)", :locale => MATCH_LOCALE do
+ get "login" => "sessions#new", :as => "login"
+ delete "logout" => "sessions#destroy", :as => "logout"
+
+ get "signup" => "users#new", :as => "signup"
+ resources :users, :except => [:create, :update] do
+ # resource :email_settings, :only => [:edit, :update]
+ # resources :email_aliases, :only => [:destroy], :id => /.*/
+ post 'deactivate', on: :member
+ post 'enable', on: :member
+ end
+ end
+
+ get "/.well-known/host-meta" => 'webfinger#host_meta'
+ get "/webfinger" => 'webfinger#search'
+ get "/key/:login" => 'keys#show'
+
end
diff --git a/core/Gemfile b/core/Gemfile
deleted file mode 100644
index b552dc5..0000000
--- a/core/Gemfile
+++ /dev/null
@@ -1,17 +0,0 @@
-source "https://rubygems.org"
-
-# Declare your gem's dependencies in leap_web_core.gemspec.
-# Bundler will treat runtime dependencies like base dependencies, and
-# development dependencies will be added by default to the :development group.
-gemspec
-
-# jquery-rails is used by the dummy application
-gem "jquery-rails"
-
-# Declare any dependencies that are still in development here instead of in
-# your gemspec. These might include edge Rails or gems from your path or
-# Git. Remember to move these dependencies to your gemspec before releasing
-# your gem to rubygems.org.
-
-# To use debugger
-# gem 'ruby-debug'
diff --git a/core/Rakefile b/core/Rakefile
deleted file mode 100644
index 3c6539c..0000000
--- a/core/Rakefile
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env rake
-
-require 'rake/packagetask'
-require 'rubygems/package_task'
-
-begin
- require 'bundler/setup'
-rescue LoadError
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
-end
-begin
- require 'rdoc/task'
-rescue LoadError
- require 'rdoc/rdoc'
- require 'rake/rdoctask'
- RDoc::Task = Rake::RDocTask
-end
-
-RDoc::Task.new(:rdoc) do |rdoc|
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'LeapWebCore'
- rdoc.options << '--line-numbers'
- rdoc.rdoc_files.include('README.rdoc')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
-
-spec = eval(File.read('leap_web_core.gemspec'))
-Gem::PackageTask.new(spec) do |p|
- p.gem_spec = spec
-end
-
-Bundler::GemHelper.install_tasks
-
-require 'rake/testtask'
-
-Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
- t.libs << 'test'
- t.pattern = 'test/**/*_test.rb'
- t.verbose = false
-end
-
-
-task :default => :test
diff --git a/core/Readme.md b/core/Readme.md
deleted file mode 100644
index 795c0a4..0000000
--- a/core/Readme.md
+++ /dev/null
@@ -1,6 +0,0 @@
-Leap Web Core
-===
-
-[Leap](http://www.leap.se) is the Leap Encryption Access Project and this is the rails app for its web interface.
-
-This is the its core gem. Currently it only serves to load shared dependencies.
diff --git a/core/config/initializers/backtrace_silencers.rb b/core/config/initializers/backtrace_silencers.rb
deleted file mode 100644
index 59385cd..0000000
--- a/core/config/initializers/backtrace_silencers.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
-# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
-
-# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
-# Rails.backtrace_cleaner.remove_silencers!
diff --git a/core/config/initializers/inflections.rb b/core/config/initializers/inflections.rb
deleted file mode 100644
index 5d8d9be..0000000
--- a/core/config/initializers/inflections.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Add new inflection rules using the following format
-# (all these examples are active by default):
-# ActiveSupport::Inflector.inflections do |inflect|
-# inflect.plural /^(ox)$/i, '\1en'
-# inflect.singular /^(ox)en/i, '\1'
-# inflect.irregular 'person', 'people'
-# inflect.uncountable %w( fish sheep )
-# end
-#
-# These inflection rules are supported but not enabled by default:
-# ActiveSupport::Inflector.inflections do |inflect|
-# inflect.acronym 'RESTful'
-# end
diff --git a/core/config/initializers/mime_types.rb b/core/config/initializers/mime_types.rb
deleted file mode 100644
index 72aca7e..0000000
--- a/core/config/initializers/mime_types.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Add new mime types for use in respond_to blocks:
-# Mime::Type.register "text/richtext", :rtf
-# Mime::Type.register_alias "text/html", :iphone
diff --git a/core/config/initializers/wrap_parameters.rb b/core/config/initializers/wrap_parameters.rb
deleted file mode 100644
index 5fe232e..0000000
--- a/core/config/initializers/wrap_parameters.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# Be sure to restart your server when you modify this file.
-#
-# This file contains settings for ActionController::ParamsWrapper which
-# is enabled by default.
-
-# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
-ActiveSupport.on_load(:action_controller) do
- wrap_parameters :format => [:json]
-end
-
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
deleted file mode 100644
index bb510d4..0000000
--- a/core/config/locales/en.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-en:
- no_such_thing: "No such %{thing}."
- thing_was_successfully_created: "%{thing} was successfully created."
- create_thing: "Create %{thing}"
-
- overview: "Overview"
- user_control_panel: "user control panel"
-
- created: "Created"
- created_by_on: "Created by %{user} on %{time}"
- updated: "Updated"
-
- none: "None"
- unknown: "Unknown"
- admin: "Admin"
- anonymous: "Anonymous"
- save: "Save"
- add: "Add"
- remove: "Remove"
- changes_saved: "Changes saved successfully."
- are_you_sure: "Are you sure? This change cannot be undone."
-
- download_client: "Download Bitmask"
- client_info: "The Bitmask application allows you to use %{provider} services."
- all_downloads_info: "It is available for %{clients}."
- other_downloads_info: "Bitmask is also available for %{clients}."
- login_info: "Log in to change your account settings, create support tickets, and manage payments."
- signup_info: "Sign up for a new user account via this website (it is better if you use the Bitmask application to sign up, but this website works too)."
- welcome: "Welcome to %{provider}."
- get_help: "Get Help"
- help_info: "Can't login? Create a new support ticket anonymously."
- example_email: 'user@domain.org'
- os:
- linux32: "Linux (32 bit)"
- linux64: "Linux (64 bit)"
- linux: "GNU/Linux"
- windows: "Windows"
- android: "Android"
- osx: "Mac OS"
- other: "(not available for your OS)"
-
diff --git a/core/config/routes.rb b/core/config/routes.rb
deleted file mode 100644
index 1daf9a4..0000000
--- a/core/config/routes.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-Rails.application.routes.draw do
-end
diff --git a/core/leap_web_core.gemspec b/core/leap_web_core.gemspec
deleted file mode 100644
index 7ca4d90..0000000
--- a/core/leap_web_core.gemspec
+++ /dev/null
@@ -1,25 +0,0 @@
-$:.push File.expand_path("../lib", __FILE__)
-
-require File.expand_path('../../lib/leap_web/version.rb', __FILE__)
-
-# Describe your gem and declare its dependencies:
-Gem::Specification.new do |s|
- s.name = "leap_web_core"
- s.version = LeapWeb::VERSION
- s.authors = ["Azul"]
- s.email = ["azul@leap.se"]
- s.homepage = "http://www.leap.se"
- s.summary = "Web interface to the leap platform - core engine"
- s.description = "This web interface provides various administrative tools for the leap platform through plugins. Currently it manages user accounts and certificates."
-
- s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile", "Readme.md"]
- s.test_files = Dir["test/**/*"]
-
- s.add_dependency "rails", "~> 3.2.11"
-
- s.add_dependency "couchrest", "~> 1.1.3"
- s.add_dependency "couchrest_model", "~> 2.0.0"
- s.add_dependency "couchrest_session_store", "~> 0.2.4"
-
- s.add_dependency "json"
-end
diff --git a/core/lib/extensions/testing.rb b/core/lib/extensions/testing.rb
deleted file mode 100644
index 8f7e73c..0000000
--- a/core/lib/extensions/testing.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-module LeapWebCore
- module AssertResponses
-
- # response that works with different TestCases:
- # ActionController::TestCase has @response
- # ActionDispatch::IntegrationTest has @response
- # Rack::Test::Methods defines last_response
- def get_response
- @response || last_response
- end
-
- def assert_attachement_filename(name)
- assert_equal %Q(attachment; filename="#{name}"),
- get_response.headers["Content-Disposition"]
- end
-
- def json_response
- response = JSON.parse(get_response.body)
- response.respond_to?(:with_indifferent_access) ?
- response.with_indifferent_access :
- response
- end
-
- def assert_json_response(object)
- assert_equal 'application/json',
- get_response.content_type.to_s.split(';').first
- if object.is_a? Hash
- object.stringify_keys! if object.respond_to? :stringify_keys!
- assert_equal object, json_response
- else
- assert_equal object.to_json, get_response.body
- end
- end
-
- def assert_json_error(object)
- object.stringify_keys! if object.respond_to? :stringify_keys!
- assert_json_response :errors => object
- end
- end
-end
-
-class ::ActionController::TestCase
- include LeapWebCore::AssertResponses
-end
-
-class ::ActionDispatch::IntegrationTest
- include LeapWebCore::AssertResponses
-end
diff --git a/core/lib/leap_web_core.rb b/core/lib/leap_web_core.rb
deleted file mode 100644
index a58d140..0000000
--- a/core/lib/leap_web_core.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-require "rails"
-
-require "couchrest"
-require "couchrest_model"
-require "couchrest_session_store"
-
-require "json"
-
-require "extensions/testing"
-require "extensions/couchrest"
-require "leap_web_core/engine"
-
-module LeapWebCore
-end
diff --git a/core/lib/leap_web_core/dependencies.rb b/core/lib/leap_web_core/dependencies.rb
deleted file mode 100644
index 877e3d1..0000000
--- a/core/lib/leap_web_core/dependencies.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-module LeapWebCore
- class Dependencies
- UI_DEV = {
- "haml-rails" => "~> 0.3.4",
- "sass-rails" => "~> 3.2.5",
- "coffee-rails" => "~> 3.2.2",
- "uglifier" => "~> 1.2.7"
- }
-
- UI = {
- "haml" => "~> 3.1.7",
- "jquery-rails" => nil,
- "simple_form" => nil,
- "bootswatch-rails", "~> 0.5.0"
- }
-
- def self.require_ui_gems
- UI.keys.each {|dep| require dep}
- if Rails.env == "development"
- # This will be run in the app including plugins that run it.
- # However not all development_dependencies might be present.
- # So we better only require those that are.
- available = Bundler.definition.specs.map(&:name)
- gems_to_require = available & UI_DEV.keys
- gems_to_require.each {|dep| require dep}
- end
- end
-
- def self.add_ui_gems_to_spec(spec)
- UI.each do |dep, version|
- spec.add_dependency dep, version
- end
-
- UI_DEV.each do |dep, version|
- spec.add_development_dependency dep, version
- end
- end
-
- end
-end
diff --git a/core/lib/leap_web_core/engine.rb b/core/lib/leap_web_core/engine.rb
deleted file mode 100644
index 940b5e2..0000000
--- a/core/lib/leap_web_core/engine.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# thou shall require all your dependencies in an engine.
-require "couchrest"
-require "couchrest_model"
-
-module LeapWebCore
- class Engine < ::Rails::Engine
-
- end
-end
diff --git a/core/lib/leap_web_core/ui_dependencies.rb b/core/lib/leap_web_core/ui_dependencies.rb
deleted file mode 100644
index 2daee37..0000000
--- a/core/lib/leap_web_core/ui_dependencies.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require "haml"
-require "jquery-rails"
-require "simple_form"
-require "bootswatch-rails"
-
-if Rails.env == "development"
- require "haml-rails"
- require "sass-rails"
- require "coffee-rails"
- require "uglifier"
-end
diff --git a/core/script/rails b/core/script/rails
deleted file mode 100755
index c2ad538..0000000
--- a/core/script/rails
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env ruby1.8
-# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
-
-ENGINE_ROOT = File.expand_path('../..', __FILE__)
-ENGINE_PATH = File.expand_path('../../lib/leap_web_core/engine', __FILE__)
-
-require 'rails/all'
-require 'rails/engine/commands'
diff --git a/billing/Gemfile b/engines/billing/Gemfile
index 30e9669..30e9669 100644
--- a/billing/Gemfile
+++ b/engines/billing/Gemfile
diff --git a/billing/README.md b/engines/billing/README.md
index 3ef6153..3ef6153 100644
--- a/billing/README.md
+++ b/engines/billing/README.md
diff --git a/billing/Rakefile b/engines/billing/Rakefile
index 52929c4..52929c4 100644
--- a/billing/Rakefile
+++ b/engines/billing/Rakefile
diff --git a/billing/app/controllers/billing_admin_controller.rb b/engines/billing/app/controllers/billing_admin_controller.rb
index e11d4ee..e11d4ee 100644
--- a/billing/app/controllers/billing_admin_controller.rb
+++ b/engines/billing/app/controllers/billing_admin_controller.rb
diff --git a/billing/app/controllers/billing_base_controller.rb b/engines/billing/app/controllers/billing_base_controller.rb
index 0453677..0453677 100644
--- a/billing/app/controllers/billing_base_controller.rb
+++ b/engines/billing/app/controllers/billing_base_controller.rb
diff --git a/billing/app/controllers/credit_card_info_controller.rb b/engines/billing/app/controllers/credit_card_info_controller.rb
index fbaa6f1..fbaa6f1 100644
--- a/billing/app/controllers/credit_card_info_controller.rb
+++ b/engines/billing/app/controllers/credit_card_info_controller.rb
diff --git a/billing/app/controllers/customer_controller.rb b/engines/billing/app/controllers/customer_controller.rb
index 6cbcb44..6cbcb44 100644
--- a/billing/app/controllers/customer_controller.rb
+++ b/engines/billing/app/controllers/customer_controller.rb
diff --git a/billing/app/controllers/payments_controller.rb b/engines/billing/app/controllers/payments_controller.rb
index fce6570..fce6570 100644
--- a/billing/app/controllers/payments_controller.rb
+++ b/engines/billing/app/controllers/payments_controller.rb
diff --git a/billing/app/controllers/subscriptions_controller.rb b/engines/billing/app/controllers/subscriptions_controller.rb
index f066b3c..f066b3c 100644
--- a/billing/app/controllers/subscriptions_controller.rb
+++ b/engines/billing/app/controllers/subscriptions_controller.rb
diff --git a/billing/app/helpers/billing_helper.rb b/engines/billing/app/helpers/billing_helper.rb
index b9e5e2e..b9e5e2e 100644
--- a/billing/app/helpers/billing_helper.rb
+++ b/engines/billing/app/helpers/billing_helper.rb
diff --git a/billing/app/helpers/braintree_form_helper.rb b/engines/billing/app/helpers/braintree_form_helper.rb
index cb322fa..cb322fa 100644
--- a/billing/app/helpers/braintree_form_helper.rb
+++ b/engines/billing/app/helpers/braintree_form_helper.rb
diff --git a/billing/app/helpers/braintree_helper.rb b/engines/billing/app/helpers/braintree_helper.rb
index 2d18b6c..2d18b6c 100644
--- a/billing/app/helpers/braintree_helper.rb
+++ b/engines/billing/app/helpers/braintree_helper.rb
diff --git a/billing/app/models/customer.rb b/engines/billing/app/models/customer.rb
index 1acc7a5..1acc7a5 100644
--- a/billing/app/models/customer.rb
+++ b/engines/billing/app/models/customer.rb
diff --git a/billing/app/views/billing_admin/show.html.haml b/engines/billing/app/views/billing_admin/show.html.haml
index 0382cf0..0382cf0 100644
--- a/billing/app/views/billing_admin/show.html.haml
+++ b/engines/billing/app/views/billing_admin/show.html.haml
diff --git a/billing/app/views/credit_card_info/confirm.html.haml b/engines/billing/app/views/credit_card_info/confirm.html.haml
index 9dd8176..9dd8176 100644
--- a/billing/app/views/credit_card_info/confirm.html.haml
+++ b/engines/billing/app/views/credit_card_info/confirm.html.haml
diff --git a/billing/app/views/credit_card_info/edit.html.haml b/engines/billing/app/views/credit_card_info/edit.html.haml
index bd86a4c..bd86a4c 100644
--- a/billing/app/views/credit_card_info/edit.html.haml
+++ b/engines/billing/app/views/credit_card_info/edit.html.haml
diff --git a/billing/app/views/customer/_customer_data.html.haml b/engines/billing/app/views/customer/_customer_data.html.haml
index e9df040..e9df040 100644
--- a/billing/app/views/customer/_customer_data.html.haml
+++ b/engines/billing/app/views/customer/_customer_data.html.haml
diff --git a/billing/app/views/customer/_transaction.html.haml b/engines/billing/app/views/customer/_transaction.html.haml
index e69de29..e69de29 100644
--- a/billing/app/views/customer/_transaction.html.haml
+++ b/engines/billing/app/views/customer/_transaction.html.haml
diff --git a/billing/app/views/customer/confirm.html.haml b/engines/billing/app/views/customer/confirm.html.haml
index 877a8ac..877a8ac 100644
--- a/billing/app/views/customer/confirm.html.haml
+++ b/engines/billing/app/views/customer/confirm.html.haml
diff --git a/billing/app/views/customer/edit.html.haml b/engines/billing/app/views/customer/edit.html.haml
index e882d53..e882d53 100644
--- a/billing/app/views/customer/edit.html.haml
+++ b/engines/billing/app/views/customer/edit.html.haml
diff --git a/billing/app/views/customer/new.html.haml b/engines/billing/app/views/customer/new.html.haml
index e1f5ba9..e1f5ba9 100644
--- a/billing/app/views/customer/new.html.haml
+++ b/engines/billing/app/views/customer/new.html.haml
diff --git a/billing/app/views/customer/show.html.haml b/engines/billing/app/views/customer/show.html.haml
index ec1779c..ec1779c 100644
--- a/billing/app/views/customer/show.html.haml
+++ b/engines/billing/app/views/customer/show.html.haml
diff --git a/billing/app/views/payments/_non_customer_fields.html.haml b/engines/billing/app/views/payments/_non_customer_fields.html.haml
index 77cfe95..77cfe95 100644
--- a/billing/app/views/payments/_non_customer_fields.html.haml
+++ b/engines/billing/app/views/payments/_non_customer_fields.html.haml
diff --git a/billing/app/views/payments/_transaction_details.html.haml b/engines/billing/app/views/payments/_transaction_details.html.haml
index 85e4f6a..85e4f6a 100644
--- a/billing/app/views/payments/_transaction_details.html.haml
+++ b/engines/billing/app/views/payments/_transaction_details.html.haml
diff --git a/billing/app/views/payments/confirm.html.haml b/engines/billing/app/views/payments/confirm.html.haml
index 45af3c9..45af3c9 100644
--- a/billing/app/views/payments/confirm.html.haml
+++ b/engines/billing/app/views/payments/confirm.html.haml
diff --git a/billing/app/views/payments/index.html.haml b/engines/billing/app/views/payments/index.html.haml
index 7a89917..7a89917 100644
--- a/billing/app/views/payments/index.html.haml
+++ b/engines/billing/app/views/payments/index.html.haml
diff --git a/billing/app/views/payments/new.html.haml b/engines/billing/app/views/payments/new.html.haml
index e9a8273..e9a8273 100644
--- a/billing/app/views/payments/new.html.haml
+++ b/engines/billing/app/views/payments/new.html.haml
diff --git a/billing/app/views/subscriptions/_subscription_details.html.haml b/engines/billing/app/views/subscriptions/_subscription_details.html.haml
index 6145c95..6145c95 100644
--- a/billing/app/views/subscriptions/_subscription_details.html.haml
+++ b/engines/billing/app/views/subscriptions/_subscription_details.html.haml
diff --git a/billing/app/views/subscriptions/create.html.haml b/engines/billing/app/views/subscriptions/create.html.haml
index 2b6c5e9..2b6c5e9 100644
--- a/billing/app/views/subscriptions/create.html.haml
+++ b/engines/billing/app/views/subscriptions/create.html.haml
diff --git a/billing/app/views/subscriptions/destroy.html.haml b/engines/billing/app/views/subscriptions/destroy.html.haml
index 44b4333..44b4333 100644
--- a/billing/app/views/subscriptions/destroy.html.haml
+++ b/engines/billing/app/views/subscriptions/destroy.html.haml
diff --git a/billing/app/views/subscriptions/index.html.haml b/engines/billing/app/views/subscriptions/index.html.haml
index 3d4e8fd..3d4e8fd 100644
--- a/billing/app/views/subscriptions/index.html.haml
+++ b/engines/billing/app/views/subscriptions/index.html.haml
diff --git a/billing/app/views/subscriptions/new.html.haml b/engines/billing/app/views/subscriptions/new.html.haml
index 4183458..4183458 100644
--- a/billing/app/views/subscriptions/new.html.haml
+++ b/engines/billing/app/views/subscriptions/new.html.haml
diff --git a/billing/app/views/subscriptions/show.html.haml b/engines/billing/app/views/subscriptions/show.html.haml
index 2699db9..2699db9 100644
--- a/billing/app/views/subscriptions/show.html.haml
+++ b/engines/billing/app/views/subscriptions/show.html.haml
diff --git a/billing/config/initializers/braintree.rb b/engines/billing/config/initializers/braintree.rb
index c0c89e2..3d87f4c 100644
--- a/billing/config/initializers/braintree.rb
+++ b/engines/billing/config/initializers/braintree.rb
@@ -9,14 +9,6 @@ else
end
#
-# we use fake braintree in tests
-#
-if Rails.env.test?
- require 'braintree_test_app'
- Rails.application.config.middleware.use BraintreeTestApp
-end
-
-#
# You can set these per environment in config/config.yml:
#
# Environment must be one of: :development, :qa, :sandbox, :production
diff --git a/billing/config/locales/en.yml b/engines/billing/config/locales/en.yml
index 1300958..1300958 100644
--- a/billing/config/locales/en.yml
+++ b/engines/billing/config/locales/en.yml
diff --git a/billing/config/routes.rb b/engines/billing/config/routes.rb
index 7263dff..7263dff 100644
--- a/billing/config/routes.rb
+++ b/engines/billing/config/routes.rb
diff --git a/billing/leap_web_billing.gemspec b/engines/billing/leap_web_billing.gemspec
index 94d92e0..ff11c98 100644
--- a/billing/leap_web_billing.gemspec
+++ b/engines/billing/leap_web_billing.gemspec
@@ -1,6 +1,6 @@
$:.push File.expand_path("../lib", __FILE__)
-require File.expand_path('../../lib/leap_web/version.rb', __FILE__)
+require File.expand_path('../../../lib/leap_web/version.rb', __FILE__)
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
@@ -12,10 +12,9 @@ Gem::Specification.new do |s|
s.summary = "Billing for LeapWeb"
s.description = "Billing System for a Leap provider"
- s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile", "README.md"]
+ s.files = Dir["{app,config,lib}/**/*"] + ["Rakefile", "README.md"]
s.test_files = Dir["test/**/*"]
- s.add_dependency "leap_web_core", LeapWeb::VERSION
# s.add_dependency "braintree-rails", "~> 0.4.5"
s.add_dependency "braintree"
#s.add_dependency "carmen-rails"
diff --git a/billing/lib/braintree_test_app.rb b/engines/billing/lib/braintree_test_app.rb
index 41c327d..41c327d 100644
--- a/billing/lib/braintree_test_app.rb
+++ b/engines/billing/lib/braintree_test_app.rb
diff --git a/billing/lib/leap_web_billing.rb b/engines/billing/lib/leap_web_billing.rb
index 288d846..288d846 100644
--- a/billing/lib/leap_web_billing.rb
+++ b/engines/billing/lib/leap_web_billing.rb
diff --git a/billing/lib/leap_web_billing/engine.rb b/engines/billing/lib/leap_web_billing/engine.rb
index 6d76add..ab574f2 100644
--- a/billing/lib/leap_web_billing/engine.rb
+++ b/engines/billing/lib/leap_web_billing/engine.rb
@@ -1,7 +1,4 @@
# thou shall require all your dependencies in an engine.
-require "leap_web_core"
-require "leap_web_core/ui_dependencies"
-
#require "braintree-rails"
require "braintree"
#require "carmen-rails"
diff --git a/billing/script/rails b/engines/billing/script/rails
index 8bd9c0a..8bd9c0a 100755
--- a/billing/script/rails
+++ b/engines/billing/script/rails
diff --git a/billing/test/integration/admin_customer_test.rb b/engines/billing/test/broken/admin_customer_test.rb
index 1b9953f..df92a0d 100644
--- a/billing/test/integration/admin_customer_test.rb
+++ b/engines/billing/test/broken/admin_customer_test.rb
@@ -1,19 +1,14 @@
require 'test_helper'
require 'fake_braintree'
-require 'capybara/rails'
-class AdminCustomerTest < ActionDispatch::IntegrationTest
- include Warden::Test::Helpers
- include Capybara::DSL
+class AdminCustomerTest < BraintreeIntegrationTest
setup do
- Warden.test_mode!
@admin = User.find_by_login('admin') || FactoryGirl.create(:user, login: 'admin')
@user = FactoryGirl.create(:user)
end
teardown do
- Warden.test_reset!
@user.destroy if @user
@admin.destroy if @admin
end
diff --git a/billing/test/integration/customer_creation_test.rb b/engines/billing/test/broken/customer_creation_test.rb
index aabd9b6..90319a9 100644
--- a/billing/test/integration/customer_creation_test.rb
+++ b/engines/billing/test/broken/customer_creation_test.rb
@@ -1,20 +1,15 @@
require 'test_helper'
require 'fake_braintree'
-require 'capybara/rails'
-class CustomerCreationTest < ActionDispatch::IntegrationTest
- include Warden::Test::Helpers
- include Capybara::DSL
+class CustomerCreationTest < BraintreeIntegrationTest
setup do
- Warden.test_mode!
@user = FactoryGirl.create(:user)
login_as @user
end
teardown do
@user.destroy
- Warden.test_reset!
end
# Let's test both steps together with capybara
diff --git a/billing/test/integration/subscription_test.rb b/engines/billing/test/broken/subscription_test.rb
index 1473eb0..cd010bd 100644
--- a/billing/test/integration/subscription_test.rb
+++ b/engines/billing/test/broken/subscription_test.rb
@@ -1,14 +1,11 @@
require 'test_helper'
require 'fake_braintree'
-require 'capybara/rails'
-class SubscriptionTest < BrowserIntegrationTest
- include Warden::Test::Helpers
+class SubscriptionTest < BraintreeIntegrationTest
include CustomerTestHelper
include StubRecordHelper
setup do
- Warden.test_mode!
@admin = User.find_by_login('admin') || FactoryGirl.create(:user, login: 'admin')
@customer = stub_customer
@braintree_customer = @customer.braintree_customer
@@ -19,7 +16,6 @@ class SubscriptionTest < BrowserIntegrationTest
end
teardown do
- Warden.test_reset!
@admin.destroy
end
diff --git a/billing/test/factories.rb b/engines/billing/test/factories.rb
index 87543b2..87543b2 100644
--- a/billing/test/factories.rb
+++ b/engines/billing/test/factories.rb
diff --git a/billing/test/functional/customer_controller_test.rb b/engines/billing/test/functional/customer_controller_test.rb
index d943e23..d943e23 100644
--- a/billing/test/functional/customer_controller_test.rb
+++ b/engines/billing/test/functional/customer_controller_test.rb
diff --git a/billing/test/functional/customers_controller_test.rb b/engines/billing/test/functional/customers_controller_test.rb
index 46c33c9..46c33c9 100644
--- a/billing/test/functional/customers_controller_test.rb
+++ b/engines/billing/test/functional/customers_controller_test.rb
diff --git a/billing/test/functional/payments_controller_test.rb b/engines/billing/test/functional/payments_controller_test.rb
index 90b7582..90b7582 100644
--- a/billing/test/functional/payments_controller_test.rb
+++ b/engines/billing/test/functional/payments_controller_test.rb
diff --git a/billing/test/functional/subscriptions_controller_test.rb b/engines/billing/test/functional/subscriptions_controller_test.rb
index a6a1057..a6a1057 100644
--- a/billing/test/functional/subscriptions_controller_test.rb
+++ b/engines/billing/test/functional/subscriptions_controller_test.rb
diff --git a/engines/billing/test/support/braintree_integration_test.rb b/engines/billing/test/support/braintree_integration_test.rb
new file mode 100644
index 0000000..976c5a2
--- /dev/null
+++ b/engines/billing/test/support/braintree_integration_test.rb
@@ -0,0 +1,18 @@
+require 'capybara/rails'
+# require 'fake_braintree' - messes up other integration tests
+require 'braintree_test_app'
+
+class BraintreeIntegrationTest < BrowserIntegrationTest
+ include Warden::Test::Helpers
+
+ setup do
+ Warden.test_mode!
+ Rails.application.config.middleware.use BraintreeTestApp
+ end
+
+ teardown do
+ Warden.test_reset!
+ Rails.application.config.middleware.delete "BraintreeTestApp"
+ end
+
+end
diff --git a/billing/test/support/customer_test_helper.rb b/engines/billing/test/support/customer_test_helper.rb
index adac00a..adac00a 100644
--- a/billing/test/support/customer_test_helper.rb
+++ b/engines/billing/test/support/customer_test_helper.rb
diff --git a/help/test/test_helper.rb b/engines/billing/test/test_helper.rb
index 3381f44..7ad3869 100644
--- a/help/test/test_helper.rb
+++ b/engines/billing/test/test_helper.rb
@@ -1,7 +1,7 @@
# Configure Rails Environment
ENV["RAILS_ENV"] = "test"
-require File.expand_path('../../../test/dummy/config/environment', __FILE__)
+require File.expand_path("../../../../dummy/config/environment.rb", __FILE__)
require "rails/test_help"
Rails.backtrace_cleaner.remove_silencers!
diff --git a/billing/test/unit/customer_test.rb b/engines/billing/test/unit/customer_test.rb
index 6156f87..6156f87 100644
--- a/billing/test/unit/customer_test.rb
+++ b/engines/billing/test/unit/customer_test.rb
diff --git a/billing/test/unit/customer_with_payment_info_test.rb b/engines/billing/test/unit/customer_with_payment_info_test.rb
index 0589a59..0589a59 100644
--- a/billing/test/unit/customer_with_payment_info_test.rb
+++ b/engines/billing/test/unit/customer_with_payment_info_test.rb
diff --git a/help/Gemfile b/engines/support/Gemfile
index ad7d29b..ad7d29b 100644
--- a/help/Gemfile
+++ b/engines/support/Gemfile
diff --git a/help/README.md b/engines/support/README.md
index c9573e6..c9573e6 100644
--- a/help/README.md
+++ b/engines/support/README.md
diff --git a/help/Rakefile b/engines/support/Rakefile
index 0e73163..0e73163 100644
--- a/help/Rakefile
+++ b/engines/support/Rakefile
diff --git a/help/app/assets/javascripts/tickets.js b/engines/support/app/assets/javascripts/tickets.js
index 18537aa..18537aa 100644
--- a/help/app/assets/javascripts/tickets.js
+++ b/engines/support/app/assets/javascripts/tickets.js
diff --git a/help/app/controllers/tickets_controller.rb b/engines/support/app/controllers/tickets_controller.rb
index d65ee43..d65ee43 100644
--- a/help/app/controllers/tickets_controller.rb
+++ b/engines/support/app/controllers/tickets_controller.rb
diff --git a/help/app/designs/ticket/by_includes_post_by.js b/engines/support/app/designs/ticket/by_includes_post_by.js
index 2eeac89..2eeac89 100644
--- a/help/app/designs/ticket/by_includes_post_by.js
+++ b/engines/support/app/designs/ticket/by_includes_post_by.js
diff --git a/help/app/designs/ticket/by_includes_post_by_and_created_at.js b/engines/support/app/designs/ticket/by_includes_post_by_and_created_at.js
index 72169b0..72169b0 100644
--- a/help/app/designs/ticket/by_includes_post_by_and_created_at.js
+++ b/engines/support/app/designs/ticket/by_includes_post_by_and_created_at.js
diff --git a/help/app/designs/ticket/by_includes_post_by_and_is_open_and_created_at.js b/engines/support/app/designs/ticket/by_includes_post_by_and_is_open_and_created_at.js
index 33dfe0b..33dfe0b 100644
--- a/help/app/designs/ticket/by_includes_post_by_and_is_open_and_created_at.js
+++ b/engines/support/app/designs/ticket/by_includes_post_by_and_is_open_and_created_at.js
diff --git a/help/app/designs/ticket/by_includes_post_by_and_is_open_and_updated_at.js b/engines/support/app/designs/ticket/by_includes_post_by_and_is_open_and_updated_at.js
index 3bd2a74..3bd2a74 100644
--- a/help/app/designs/ticket/by_includes_post_by_and_is_open_and_updated_at.js
+++ b/engines/support/app/designs/ticket/by_includes_post_by_and_is_open_and_updated_at.js
diff --git a/help/app/designs/ticket/by_includes_post_by_and_updated_at.js b/engines/support/app/designs/ticket/by_includes_post_by_and_updated_at.js
index 2b4304f..2b4304f 100644
--- a/help/app/designs/ticket/by_includes_post_by_and_updated_at.js
+++ b/engines/support/app/designs/ticket/by_includes_post_by_and_updated_at.js
diff --git a/help/app/helpers/auto_tickets_path_helper.rb b/engines/support/app/helpers/auto_tickets_path_helper.rb
index 93f3cb9..93f3cb9 100644
--- a/help/app/helpers/auto_tickets_path_helper.rb
+++ b/engines/support/app/helpers/auto_tickets_path_helper.rb
diff --git a/help/app/helpers/tickets_helper.rb b/engines/support/app/helpers/tickets_helper.rb
index 7af50d6..7af50d6 100644
--- a/help/app/helpers/tickets_helper.rb
+++ b/engines/support/app/helpers/tickets_helper.rb
diff --git a/help/app/models/account_extension/tickets.rb b/engines/support/app/models/account_extension/tickets.rb
index f898b56..f898b56 100644
--- a/help/app/models/account_extension/tickets.rb
+++ b/engines/support/app/models/account_extension/tickets.rb
diff --git a/help/app/models/ticket.rb b/engines/support/app/models/ticket.rb
index cd22758..cd22758 100644
--- a/help/app/models/ticket.rb
+++ b/engines/support/app/models/ticket.rb
diff --git a/help/app/models/ticket_comment.rb b/engines/support/app/models/ticket_comment.rb
index bed5237..bed5237 100644
--- a/help/app/models/ticket_comment.rb
+++ b/engines/support/app/models/ticket_comment.rb
diff --git a/help/app/models/ticket_selection.rb b/engines/support/app/models/ticket_selection.rb
index 74d5b78..74d5b78 100644
--- a/help/app/models/ticket_selection.rb
+++ b/engines/support/app/models/ticket_selection.rb
diff --git a/help/app/views/tickets/_comment.html.haml b/engines/support/app/views/tickets/_comment.html.haml
index 778ca13..778ca13 100644
--- a/help/app/views/tickets/_comment.html.haml
+++ b/engines/support/app/views/tickets/_comment.html.haml
diff --git a/help/app/views/tickets/_edit_form.html.haml b/engines/support/app/views/tickets/_edit_form.html.haml
index 714f8ff..714f8ff 100644
--- a/help/app/views/tickets/_edit_form.html.haml
+++ b/engines/support/app/views/tickets/_edit_form.html.haml
diff --git a/help/app/views/tickets/_new_comment_form.html.haml b/engines/support/app/views/tickets/_new_comment_form.html.haml
index 8418e01..8418e01 100644
--- a/help/app/views/tickets/_new_comment_form.html.haml
+++ b/engines/support/app/views/tickets/_new_comment_form.html.haml
diff --git a/help/app/views/tickets/_tabs.html.haml b/engines/support/app/views/tickets/_tabs.html.haml
index b7b5d3a..b7b5d3a 100644
--- a/help/app/views/tickets/_tabs.html.haml
+++ b/engines/support/app/views/tickets/_tabs.html.haml
diff --git a/help/app/views/tickets/_ticket.html.haml b/engines/support/app/views/tickets/_ticket.html.haml
index 5bc33c8..5bc33c8 100644
--- a/help/app/views/tickets/_ticket.html.haml
+++ b/engines/support/app/views/tickets/_ticket.html.haml
diff --git a/help/app/views/tickets/index.html.haml b/engines/support/app/views/tickets/index.html.haml
index c02a326..c02a326 100644
--- a/help/app/views/tickets/index.html.haml
+++ b/engines/support/app/views/tickets/index.html.haml
diff --git a/help/app/views/tickets/new.html.haml b/engines/support/app/views/tickets/new.html.haml
index 8f217a5..8f217a5 100644
--- a/help/app/views/tickets/new.html.haml
+++ b/engines/support/app/views/tickets/new.html.haml
diff --git a/help/app/views/tickets/show.html.haml b/engines/support/app/views/tickets/show.html.haml
index bfdb773..bfdb773 100644
--- a/help/app/views/tickets/show.html.haml
+++ b/engines/support/app/views/tickets/show.html.haml
diff --git a/help/config/initializers/account_lifecycle.rb b/engines/support/config/initializers/account_lifecycle.rb
index d9f04c1..d9f04c1 100644
--- a/help/config/initializers/account_lifecycle.rb
+++ b/engines/support/config/initializers/account_lifecycle.rb
diff --git a/help/config/locales/en.yml b/engines/support/config/locales/en.yml
index 342adea..342adea 100644
--- a/help/config/locales/en.yml
+++ b/engines/support/config/locales/en.yml
diff --git a/help/config/routes.rb b/engines/support/config/routes.rb
index 23e0c11..23e0c11 100644
--- a/help/config/routes.rb
+++ b/engines/support/config/routes.rb
diff --git a/help/leap_web_help.gemspec b/engines/support/leap_web_help.gemspec
index 4914694..7b668d5 100644
--- a/help/leap_web_help.gemspec
+++ b/engines/support/leap_web_help.gemspec
@@ -1,6 +1,6 @@
-$:.push File.expand_path("../lib", __FILE__)
+$:.push File.expand_path("../../lib", __FILE__)
-require File.expand_path('../../lib/leap_web/version.rb', __FILE__)
+require File.expand_path('../../../lib/leap_web/version.rb', __FILE__)
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
@@ -12,8 +12,7 @@ Gem::Specification.new do |s|
s.summary = "Help Desk for LeapWeb"
s.description = "Managing Tickets for a Leap provider"
- s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile", "README.md"]
+ s.files = Dir["{app,config,lib}/**/*"] + ["Rakefile", "README.md"]
s.test_files = Dir["test/**/*"]
- s.add_dependency "leap_web_core", LeapWeb::VERSION
end
diff --git a/help/lib/leap_web_help.rb b/engines/support/lib/leap_web_help.rb
index f5b04aa..f5b04aa 100644
--- a/help/lib/leap_web_help.rb
+++ b/engines/support/lib/leap_web_help.rb
diff --git a/engines/support/lib/leap_web_help/engine.rb b/engines/support/lib/leap_web_help/engine.rb
new file mode 100644
index 0000000..dfa763f
--- /dev/null
+++ b/engines/support/lib/leap_web_help/engine.rb
@@ -0,0 +1,4 @@
+module LeapWebHelp
+ class Engine < ::Rails::Engine
+ end
+end
diff --git a/help/lib/tasks/leap_web_help_tasks.rake b/engines/support/lib/tasks/leap_web_help_tasks.rake
index 1f38982..1f38982 100644
--- a/help/lib/tasks/leap_web_help_tasks.rake
+++ b/engines/support/lib/tasks/leap_web_help_tasks.rake
diff --git a/help/script/rails b/engines/support/script/rails
index 5676ab9..5676ab9 100755
--- a/help/script/rails
+++ b/engines/support/script/rails
diff --git a/help/test/factories.rb b/engines/support/test/factories.rb
index be04f15..be04f15 100644
--- a/help/test/factories.rb
+++ b/engines/support/test/factories.rb
diff --git a/help/test/functional/tickets_controller_test.rb b/engines/support/test/functional/tickets_controller_test.rb
index 416fb73..416fb73 100644
--- a/help/test/functional/tickets_controller_test.rb
+++ b/engines/support/test/functional/tickets_controller_test.rb
diff --git a/certs/test/integration/navigation_test.rb b/engines/support/test/integration/navigation_test.rb
index eec8c0e..eec8c0e 100644
--- a/certs/test/integration/navigation_test.rb
+++ b/engines/support/test/integration/navigation_test.rb
diff --git a/help/test/leap_web_help_test.rb b/engines/support/test/leap_web_help_test.rb
index d74c087..d74c087 100644
--- a/help/test/leap_web_help_test.rb
+++ b/engines/support/test/leap_web_help_test.rb
diff --git a/billing/test/test_helper.rb b/engines/support/test/test_helper.rb
index 1e26a31..fff9173 100644
--- a/billing/test/test_helper.rb
+++ b/engines/support/test/test_helper.rb
@@ -1,7 +1,7 @@
# Configure Rails Environment
ENV["RAILS_ENV"] = "test"
-require File.expand_path("../dummy/config/environment.rb", __FILE__)
+require File.expand_path('../../../../test/dummy/config/environment', __FILE__)
require "rails/test_help"
Rails.backtrace_cleaner.remove_silencers!
diff --git a/help/test/unit/account_extension_test.rb b/engines/support/test/unit/account_extension_test.rb
index aba162c..aba162c 100644
--- a/help/test/unit/account_extension_test.rb
+++ b/engines/support/test/unit/account_extension_test.rb
diff --git a/help/test/unit/ticket_comment_test.rb b/engines/support/test/unit/ticket_comment_test.rb
index fe8cc95..fe8cc95 100644
--- a/help/test/unit/ticket_comment_test.rb
+++ b/engines/support/test/unit/ticket_comment_test.rb
diff --git a/help/test/unit/ticket_test.rb b/engines/support/test/unit/ticket_test.rb
index f5e6ea7..f5e6ea7 100644
--- a/help/test/unit/ticket_test.rb
+++ b/engines/support/test/unit/ticket_test.rb
diff --git a/help/lib/leap_web_help/engine.rb b/help/lib/leap_web_help/engine.rb
deleted file mode 100644
index 4146dfc..0000000
--- a/help/lib/leap_web_help/engine.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# thou shall require all your dependencies in an engine.
-require "leap_web_core"
-require "leap_web_core/ui_dependencies"
-
-module LeapWebHelp
- class Engine < ::Rails::Engine
- end
-end
diff --git a/leap_web.gemspec b/leap_web.gemspec
index 44a30e0..125c930 100644
--- a/leap_web.gemspec
+++ b/leap_web.gemspec
@@ -19,7 +19,4 @@ Gem::Specification.new do |s|
s.email = 'azul@leap.se'
s.homepage = 'http://leap.se'
- # s.add_dependency 'leap_web_core'
- s.add_dependency 'leap_web_certs', LeapWeb::VERSION
- s.add_dependency 'leap_web_users', LeapWeb::VERSION
end
diff --git a/core/lib/extensions/couchrest.rb b/lib/extensions/couchrest.rb
index a9a195e..95f5d92 100644
--- a/core/lib/extensions/couchrest.rb
+++ b/lib/extensions/couchrest.rb
@@ -45,7 +45,7 @@ module CouchRest
def self.load_all_models_with_engines
self.load_all_models_without_engines
return unless defined?(Rails)
- Dir[Rails.root + '*/app/models/**/*.rb'].each do |path|
+ Dir[Rails.root + 'engines/*/app/models/**/*.rb'].each do |path|
require path
end
end
diff --git a/lib/leap_web.rb b/lib/leap_web.rb
deleted file mode 100644
index 9495fc6..0000000
--- a/lib/leap_web.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'leap_web_core'
-require 'leap_web_certs'
-require 'leap_web_users'
-# do we want billing and help here?
diff --git a/core/lib/tasks/leap_web_core_tasks.rake b/lib/tasks/leap_web_core_tasks.rake
index ec6abac..ec6abac 100644
--- a/core/lib/tasks/leap_web_core_tasks.rake
+++ b/lib/tasks/leap_web_core_tasks.rake
diff --git a/users/lib/tasks/leap_web_users_tasks.rake b/lib/tasks/leap_web_users_tasks.rake
index 62bcbe9..62bcbe9 100644
--- a/users/lib/tasks/leap_web_users_tasks.rake
+++ b/lib/tasks/leap_web_users_tasks.rake
diff --git a/lib/tasks/test.rake b/lib/tasks/test.rake
index 3c87b45..d96b625 100644
--- a/lib/tasks/test.rake
+++ b/lib/tasks/test.rake
@@ -1,18 +1,11 @@
namespace :test do
- Rails::SubTestTask.new(:units => "test:prepare") do |t|
- t.libs << "test"
- t.pattern = '*/test/unit/**/*_test.rb'
- end
-
- Rails::SubTestTask.new(:functionals => "test:prepare") do |t|
- t.libs << "test"
- t.pattern = '*/test/functional/**/*_test.rb'
- end
-
- Rails::SubTestTask.new(:integration => "test:prepare") do |t|
- t.libs << "test"
- t.pattern = '*/test/integration/**/*_test.rb'
+ [:units, :functionals, :integration].each do |type|
+ Rails::SubTestTask.new(type => "test:prepare") do |t|
+ t.libs << "test"
+ subdir = type.to_s.singularize
+ t.pattern = "engines/*/test/#{subdir}/**/*_test.rb"
+ end
end
end
diff --git a/users/lib/warden/session_serializer.rb b/lib/warden/session_serializer.rb
index 81d7076..81d7076 100644
--- a/users/lib/warden/session_serializer.rb
+++ b/lib/warden/session_serializer.rb
diff --git a/users/lib/warden/strategies/secure_remote_password.rb b/lib/warden/strategies/secure_remote_password.rb
index 2c334c6..2c334c6 100644
--- a/users/lib/warden/strategies/secure_remote_password.rb
+++ b/lib/warden/strategies/secure_remote_password.rb
diff --git a/users/lib/webfinger.rb b/lib/webfinger.rb
index dd49b41..dd49b41 100644
--- a/users/lib/webfinger.rb
+++ b/lib/webfinger.rb
diff --git a/users/lib/webfinger/host_meta_presenter.rb b/lib/webfinger/host_meta_presenter.rb
index 84ab7a9..84ab7a9 100644
--- a/users/lib/webfinger/host_meta_presenter.rb
+++ b/lib/webfinger/host_meta_presenter.rb
diff --git a/users/lib/webfinger/user_presenter.rb b/lib/webfinger/user_presenter.rb
index 329f477..329f477 100644
--- a/users/lib/webfinger/user_presenter.rb
+++ b/lib/webfinger/user_presenter.rb
diff --git a/test/factories.rb b/test/factories.rb
index 6c671f8..ac9333c 100644
--- a/test/factories.rb
+++ b/test/factories.rb
@@ -1,3 +1,39 @@
-Dir.glob(Rails.root.join('**','test','factories.rb')) do |factory_file|
+ENGINE_FACTORY_FILES = Rails.root.join('engines','*','test','factories.rb')
+Dir.glob(ENGINE_FACTORY_FILES) do |factory_file|
require factory_file
end
+
+FactoryGirl.define do
+
+ factory :user do
+ login { Faker::Internet.user_name }
+ password_verifier "1234ABCD"
+ password_salt "4321AB"
+
+ factory :user_with_settings do
+ email_forward { Faker::Internet.email }
+ email_aliases_attributes do
+ {:a => Faker::Internet.user_name + '@' + APP_CONFIG[:domain]}
+ end
+ end
+
+ factory :admin_user do
+ after(:build) do |admin|
+ admin.stubs(:is_admin?).returns(true)
+ end
+ end
+ end
+
+ factory :token do
+ user
+ end
+
+ factory :pgp_key do
+ keyblock <<-EOPGP
+-----BEGIN PGP PUBLIC KEY BLOCK-----
++Dummy+PGP+KEY+++Dummy+PGP+KEY+++Dummy+PGP+KEY+++Dummy+PGP+KEY+
+#{SecureRandom.base64(4032)}
+-----END PGP PUBLIC KEY BLOCK-----
+ EOPGP
+ end
+end
diff --git a/certs/test/files/ca.crt b/test/files/ca.crt
index 8393eee..8393eee 100644
--- a/certs/test/files/ca.crt
+++ b/test/files/ca.crt
diff --git a/certs/test/files/ca.key b/test/files/ca.key
index 125997f..125997f 100644
--- a/certs/test/files/ca.key
+++ b/test/files/ca.key
diff --git a/users/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb
index c4c922b..c4c922b 100644
--- a/users/test/functional/application_controller_test.rb
+++ b/test/functional/application_controller_test.rb
diff --git a/users/test/functional/helper_methods_test.rb b/test/functional/helper_methods_test.rb
index 44226ae..44226ae 100644
--- a/users/test/functional/helper_methods_test.rb
+++ b/test/functional/helper_methods_test.rb
diff --git a/users/test/functional/keys_controller_test.rb b/test/functional/keys_controller_test.rb
index 863be93..863be93 100644
--- a/users/test/functional/keys_controller_test.rb
+++ b/test/functional/keys_controller_test.rb
diff --git a/users/test/functional/sessions_controller_test.rb b/test/functional/sessions_controller_test.rb
index fe7903f..fe7903f 100644
--- a/users/test/functional/sessions_controller_test.rb
+++ b/test/functional/sessions_controller_test.rb
diff --git a/users/test/functional/test_helpers_test.rb b/test/functional/test_helpers_test.rb
index 845e516..845e516 100644
--- a/users/test/functional/test_helpers_test.rb
+++ b/test/functional/test_helpers_test.rb
diff --git a/users/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb
index 0713836..0713836 100644
--- a/users/test/functional/users_controller_test.rb
+++ b/test/functional/users_controller_test.rb
diff --git a/certs/test/functional/certs_controller_test.rb b/test/functional/v1/certs_controller_test.rb
index 503e74b..2c70e52 100644
--- a/certs/test/functional/certs_controller_test.rb
+++ b/test/functional/v1/certs_controller_test.rb
@@ -1,6 +1,6 @@
require 'test_helper'
-class CertsControllerTest < ActionController::TestCase
+class V1::CertsControllerTest < ActionController::TestCase
test "send limited cert without login" do
with_config allow_limited_certs: true, allow_anonymous_certs: true do
diff --git a/users/test/functional/v1/messages_controller_test.rb b/test/functional/v1/messages_controller_test.rb
index 24a5b1f..24a5b1f 100644
--- a/users/test/functional/v1/messages_controller_test.rb
+++ b/test/functional/v1/messages_controller_test.rb
diff --git a/users/test/functional/v1/sessions_controller_test.rb b/test/functional/v1/sessions_controller_test.rb
index df0d681..df0d681 100644
--- a/users/test/functional/v1/sessions_controller_test.rb
+++ b/test/functional/v1/sessions_controller_test.rb
diff --git a/users/test/functional/v1/users_controller_test.rb b/test/functional/v1/users_controller_test.rb
index 7cd9b0c..7cd9b0c 100644
--- a/users/test/functional/v1/users_controller_test.rb
+++ b/test/functional/v1/users_controller_test.rb
diff --git a/users/test/functional/webfinger_controller_test.rb b/test/functional/webfinger_controller_test.rb
index 6597b69..6597b69 100644
--- a/users/test/functional/webfinger_controller_test.rb
+++ b/test/functional/webfinger_controller_test.rb
diff --git a/users/test/integration/api/Readme.md b/test/integration/api/Readme.md
index 04363bd..04363bd 100644
--- a/users/test/integration/api/Readme.md
+++ b/test/integration/api/Readme.md
diff --git a/users/test/integration/api/login_test.rb b/test/integration/api/login_test.rb
index 92d153f..92d153f 100644
--- a/users/test/integration/api/login_test.rb
+++ b/test/integration/api/login_test.rb
diff --git a/users/test/integration/api/pgp_key_test.rb b/test/integration/api/pgp_key_test.rb
index 4c7fb4c..4c7fb4c 100644
--- a/users/test/integration/api/pgp_key_test.rb
+++ b/test/integration/api/pgp_key_test.rb
diff --git a/users/test/integration/api/python/flow_with_srp.py b/test/integration/api/python/flow_with_srp.py
index 9fc168b..9fc168b 100755
--- a/users/test/integration/api/python/flow_with_srp.py
+++ b/test/integration/api/python/flow_with_srp.py
diff --git a/users/test/integration/api/python/login_wrong_username.py b/test/integration/api/python/login_wrong_username.py
index 390f250..390f250 100755
--- a/users/test/integration/api/python/login_wrong_username.py
+++ b/test/integration/api/python/login_wrong_username.py
diff --git a/users/test/integration/api/python/signup.py b/test/integration/api/python/signup.py
index 0d3a4e0..0d3a4e0 100755
--- a/users/test/integration/api/python/signup.py
+++ b/test/integration/api/python/signup.py
diff --git a/users/test/integration/api/python/signup_and_login.py b/test/integration/api/python/signup_and_login.py
index ac611d7..ac611d7 100755
--- a/users/test/integration/api/python/signup_and_login.py
+++ b/test/integration/api/python/signup_and_login.py
diff --git a/users/test/integration/api/python/signup_and_login_wrong_password.py b/test/integration/api/python/signup_and_login_wrong_password.py
index 9efffa1..9efffa1 100755
--- a/users/test/integration/api/python/signup_and_login_wrong_password.py
+++ b/test/integration/api/python/signup_and_login_wrong_password.py
diff --git a/users/test/integration/api/python/umlauts.py b/test/integration/api/python/umlauts.py
index 96fecbf..96fecbf 100755
--- a/users/test/integration/api/python/umlauts.py
+++ b/test/integration/api/python/umlauts.py
diff --git a/users/test/integration/api/signup_test.rb b/test/integration/api/signup_test.rb
index 236c547..236c547 100644
--- a/users/test/integration/api/signup_test.rb
+++ b/test/integration/api/signup_test.rb
diff --git a/users/test/integration/api/srp_test.rb b/test/integration/api/srp_test.rb
index 946450e..26adc8c 100644
--- a/users/test/integration/api/srp_test.rb
+++ b/test/integration/api/srp_test.rb
@@ -1,4 +1,5 @@
class SrpTest < RackTest
+ include AssertResponses
teardown do
if @user
diff --git a/users/test/integration/api/update_account_test.rb b/test/integration/api/update_account_test.rb
index 63429e7..63429e7 100644
--- a/users/test/integration/api/update_account_test.rb
+++ b/test/integration/api/update_account_test.rb
diff --git a/users/test/integration/browser/account_test.rb b/test/integration/browser/account_test.rb
index a5677ad..a5677ad 100644
--- a/users/test/integration/browser/account_test.rb
+++ b/test/integration/browser/account_test.rb
diff --git a/users/test/integration/browser/session_test.rb b/test/integration/browser/session_test.rb
index 3a41b3a..3a41b3a 100644
--- a/users/test/integration/browser/session_test.rb
+++ b/test/integration/browser/session_test.rb
diff --git a/help/test/integration/navigation_test.rb b/test/integration/navigation_test.rb
index eec8c0e..eec8c0e 100644
--- a/help/test/integration/navigation_test.rb
+++ b/test/integration/navigation_test.rb
diff --git a/users/test/leap_web_users_test.rb b/test/leap_web_users_test.rb
index f142e54..f142e54 100644
--- a/users/test/leap_web_users_test.rb
+++ b/test/leap_web_users_test.rb
diff --git a/test/support/assert_responses.rb b/test/support/assert_responses.rb
new file mode 100644
index 0000000..b01166f
--- /dev/null
+++ b/test/support/assert_responses.rb
@@ -0,0 +1,46 @@
+module AssertResponses
+
+ # response that works with different TestCases:
+ # ActionController::TestCase has @response
+ # ActionDispatch::IntegrationTest has @response
+ # Rack::Test::Methods defines last_response
+ def get_response
+ @response || last_response
+ end
+
+ def assert_attachement_filename(name)
+ assert_equal %Q(attachment; filename="#{name}"),
+ get_response.headers["Content-Disposition"]
+ end
+
+ def json_response
+ response = JSON.parse(get_response.body)
+ response.respond_to?(:with_indifferent_access) ?
+ response.with_indifferent_access :
+ response
+ end
+
+ def assert_json_response(object)
+ assert_equal 'application/json',
+ get_response.content_type.to_s.split(';').first
+ if object.is_a? Hash
+ object.stringify_keys! if object.respond_to? :stringify_keys!
+ assert_equal object, json_response
+ else
+ assert_equal object.to_json, get_response.body
+ end
+ end
+
+ def assert_json_error(object)
+ object.stringify_keys! if object.respond_to? :stringify_keys!
+ assert_json_response :errors => object
+ end
+end
+
+class ::ActionController::TestCase
+ include AssertResponses
+end
+
+class ::ActionDispatch::IntegrationTest
+ include AssertResponses
+end
diff --git a/users/test/support/auth_test_helper.rb b/test/support/auth_test_helper.rb
index 57f9f9b..57f9f9b 100644
--- a/users/test/support/auth_test_helper.rb
+++ b/test/support/auth_test_helper.rb
diff --git a/core/test/support/browser_integration_test.rb b/test/support/browser_integration_test.rb
index 2885c3a..2885c3a 100644
--- a/core/test/support/browser_integration_test.rb
+++ b/test/support/browser_integration_test.rb
diff --git a/core/test/support/rack_test.rb b/test/support/rack_test.rb
index 2d8e5c4..806339a 100644
--- a/core/test/support/rack_test.rb
+++ b/test/support/rack_test.rb
@@ -1,7 +1,8 @@
+require_relative 'assert_responses'
+
class RackTest < ActiveSupport::TestCase
include Rack::Test::Methods
include Warden::Test::Helpers
- include LeapWebCore::AssertResponses
CONFIG_RU = (Rails.root + 'config.ru').to_s
OUTER_APP = Rack::Builder.parse_file(CONFIG_RU).first
diff --git a/users/test/support/stub_record_helper.rb b/test/support/stub_record_helper.rb
index 25138a0..25138a0 100644
--- a/users/test/support/stub_record_helper.rb
+++ b/test/support/stub_record_helper.rb
diff --git a/users/test/support/time_test_helper.rb b/test/support/time_test_helper.rb
index f673f12..f673f12 100644
--- a/users/test/support/time_test_helper.rb
+++ b/test/support/time_test_helper.rb
diff --git a/core/test/support/with_config_helper.rb b/test/support/with_config_helper.rb
index 65eb7bc..65eb7bc 100644
--- a/core/test/support/with_config_helper.rb
+++ b/test/support/with_config_helper.rb
diff --git a/test/test_helper.rb b/test/test_helper.rb
index f63591f..d001ac7 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -4,8 +4,11 @@ require 'rails/test_help'
require 'mocha/setup'
+# Load support files from toplevel
+Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
+
# Load support files from all engines
-Dir["#{File.dirname(__FILE__)}/../*/test/support/**/*.rb"].each { |f| require f }
+Dir["#{File.dirname(__FILE__)}/../engines/*/test/support/**/*.rb"].each { |f| require f }
class ActiveSupport::TestCase
# Add more helper methods to be used by all tests here...
diff --git a/users/test/unit/account_test.rb b/test/unit/account_test.rb
index 4fb3c3d..4fb3c3d 100644
--- a/users/test/unit/account_test.rb
+++ b/test/unit/account_test.rb
diff --git a/certs/test/unit/client_certificate_test.rb b/test/unit/client_certificate_test.rb
index 036e724..036e724 100644
--- a/certs/test/unit/client_certificate_test.rb
+++ b/test/unit/client_certificate_test.rb
diff --git a/users/test/unit/helpers/session_helper_test.rb b/test/unit/helpers/session_helper_test.rb
index 2824733..2824733 100644
--- a/users/test/unit/helpers/session_helper_test.rb
+++ b/test/unit/helpers/session_helper_test.rb
diff --git a/users/test/unit/helpers/users_helper_test.rb b/test/unit/helpers/users_helper_test.rb
index 96af37a..96af37a 100644
--- a/users/test/unit/helpers/users_helper_test.rb
+++ b/test/unit/helpers/users_helper_test.rb
diff --git a/users/test/unit/identity_test.rb b/test/unit/identity_test.rb
index eca104f..eca104f 100644
--- a/users/test/unit/identity_test.rb
+++ b/test/unit/identity_test.rb
diff --git a/users/test/unit/local_email_test.rb b/test/unit/local_email_test.rb
index 20ee7f1..20ee7f1 100644
--- a/users/test/unit/local_email_test.rb
+++ b/test/unit/local_email_test.rb
diff --git a/users/test/unit/token_test.rb b/test/unit/token_test.rb
index a3c6cf6..a3c6cf6 100644
--- a/users/test/unit/token_test.rb
+++ b/test/unit/token_test.rb
diff --git a/users/test/unit/unauthenticated_user_test.rb b/test/unit/unauthenticated_user_test.rb
index e5fafb8..e5fafb8 100644
--- a/users/test/unit/unauthenticated_user_test.rb
+++ b/test/unit/unauthenticated_user_test.rb
diff --git a/users/test/unit/user_test.rb b/test/unit/user_test.rb
index ffbb7d8..ffbb7d8 100644
--- a/users/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
diff --git a/users/test/unit/warden_strategy_secure_remote_password_test.rb b/test/unit/warden_strategy_secure_remote_password_test.rb
index e6fcfbe..e6fcfbe 100644
--- a/users/test/unit/warden_strategy_secure_remote_password_test.rb
+++ b/test/unit/warden_strategy_secure_remote_password_test.rb
diff --git a/users/test/unit/webfinger/host_meta_presenter_test.rb b/test/unit/webfinger/host_meta_presenter_test.rb
index af86404..af86404 100644
--- a/users/test/unit/webfinger/host_meta_presenter_test.rb
+++ b/test/unit/webfinger/host_meta_presenter_test.rb
diff --git a/users/test/unit/webfinger/user_presenter_test.rb b/test/unit/webfinger/user_presenter_test.rb
index 04aeb22..04aeb22 100644
--- a/users/test/unit/webfinger/user_presenter_test.rb
+++ b/test/unit/webfinger/user_presenter_test.rb
diff --git a/ui_dependencies.rb b/ui_dependencies.rb
deleted file mode 100644
index 4b5d706..0000000
--- a/ui_dependencies.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-gem "haml", "~> 3.1.7"
-gem "bootstrap-sass", "= 2.3.2.2"
-gem "jquery-rails"
-gem "simple_form"
-gem 'client_side_validations'
-gem 'client_side_validations-simple_form'
-gem "bootswatch-rails", "~> 0.5.0"
-
-gem 'kaminari', "0.13.0" # for pagination. trying 0.13.0 as there seem to be
- # issues with 0.14.0 when using couchrest
-
-gem 'rails-i18n' # locale files for built-in validation messages and times
- # https://github.com/svenfuchs/rails-i18n
- # for a list of keys:
- # https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/en.yml
-
-gem 'rdiscount' # for rendering .md templates
-
-group :assets do
- gem "haml-rails", "~> 0.3.4"
- gem "sass-rails", "~> 3.2.5"
- gem "coffee-rails", "~> 3.2.2"
- gem "uglifier", "~> 1.2.7"
-
- # See https://github.com/sstephenson/execjs#readme for more supported runtimes
- gem 'therubyracer', "~> 0.10.2", :platforms => :ruby
-
-end
diff --git a/users/Gemfile b/users/Gemfile
deleted file mode 100644
index 4101ead..0000000
--- a/users/Gemfile
+++ /dev/null
@@ -1,15 +0,0 @@
-source "https://rubygems.org"
-
-eval(File.read(File.dirname(__FILE__) + '/../common_dependencies.rb'))
-eval(File.read(File.dirname(__FILE__) + '/../ui_dependencies.rb'))
-
-# We require leap_web_core from here so we can use the path option.
-gem "leap_web_core", :path => '../core'
-
-# Declare your gem's dependencies in leap_web_users.gemspec.
-# Bundler will treat runtime dependencies like base dependencies, and
-# development dependencies will be added by default to the :development group.
-gemspec
-
-# To use debugger
-# gem 'ruby-debug'
diff --git a/users/Rakefile b/users/Rakefile
deleted file mode 100644
index 38da5fc..0000000
--- a/users/Rakefile
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env rake
-
-require 'rake/packagetask'
-require 'rubygems/package_task'
-
-begin
- require 'bundler/setup'
-rescue LoadError
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
-end
-begin
- require 'rdoc/task'
-rescue LoadError
- require 'rdoc/rdoc'
- require 'rake/rdoctask'
- RDoc::Task = Rake::RDocTask
-end
-
-RDoc::Task.new(:rdoc) do |rdoc|
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'LeapWebUsers'
- rdoc.options << '--line-numbers'
- rdoc.rdoc_files.include('README.rdoc')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
-
-spec = eval(File.read('leap_web_users.gemspec'))
-Gem::PackageTask.new(spec) do |p|
- p.gem_spec = spec
-end
-
-Bundler::GemHelper.install_tasks
-
-require 'rake/testtask'
-
-Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
- t.libs << 'test'
- t.pattern = 'test/**/*_test.rb'
- t.verbose = false
-end
-
-
-task :default => :test
diff --git a/users/app/assets/images/leap_web_users/.gitkeep b/users/app/assets/images/leap_web_users/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/users/app/assets/images/leap_web_users/.gitkeep
+++ /dev/null
diff --git a/users/app/assets/javascripts/leap_web_users/.gitkeep b/users/app/assets/javascripts/leap_web_users/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/users/app/assets/javascripts/leap_web_users/.gitkeep
+++ /dev/null
diff --git a/users/app/assets/stylesheets/leap_web_users/.gitkeep b/users/app/assets/stylesheets/leap_web_users/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/users/app/assets/stylesheets/leap_web_users/.gitkeep
+++ /dev/null
diff --git a/users/app/controllers/.gitkeep b/users/app/controllers/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/users/app/controllers/.gitkeep
+++ /dev/null
diff --git a/users/app/helpers/.gitkeep b/users/app/helpers/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/users/app/helpers/.gitkeep
+++ /dev/null
diff --git a/users/app/mailers/.gitkeep b/users/app/mailers/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/users/app/mailers/.gitkeep
+++ /dev/null
diff --git a/users/app/models/.gitkeep b/users/app/models/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/users/app/models/.gitkeep
+++ /dev/null
diff --git a/users/app/views/.gitkeep b/users/app/views/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/users/app/views/.gitkeep
+++ /dev/null
diff --git a/users/config/routes.rb b/users/config/routes.rb
deleted file mode 100644
index 2819fa9..0000000
--- a/users/config/routes.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-Rails.application.routes.draw do
-
- namespace "api", { module: "v1",
- path: "/1/",
- defaults: {format: 'json'} } do
- resources :sessions, :only => [:new, :create, :update]
- delete "logout" => "sessions#destroy", :as => "logout"
- resources :users, :only => [:create, :update, :destroy, :index]
- resources :messages, :only => [:index, :update]
- end
-
- scope "(:locale)", :locale => MATCH_LOCALE do
- get "login" => "sessions#new", :as => "login"
- delete "logout" => "sessions#destroy", :as => "logout"
-
- get "signup" => "users#new", :as => "signup"
- resources :users, :except => [:create, :update] do
- # resource :email_settings, :only => [:edit, :update]
- # resources :email_aliases, :only => [:destroy], :id => /.*/
- post 'deactivate', on: :member
- post 'enable', on: :member
- end
- end
-
- get "/.well-known/host-meta" => 'webfinger#host_meta'
- get "/webfinger" => 'webfinger#search'
- get "/key/:login" => 'keys#show'
-
-end
diff --git a/users/leap_web_users.gemspec b/users/leap_web_users.gemspec
deleted file mode 100644
index 7d1f220..0000000
--- a/users/leap_web_users.gemspec
+++ /dev/null
@@ -1,22 +0,0 @@
-$:.push File.expand_path("../lib", __FILE__)
-
-require File.expand_path('../../lib/leap_web/version.rb', __FILE__)
-
-# Describe your gem and declare its dependencies:
-Gem::Specification.new do |s|
- s.name = "leap_web_users"
- s.version = LeapWeb::VERSION
- s.authors = ["Azul"]
- s.email = ["azul@leap.se"]
- s.homepage = "http://www.leap.se"
- s.summary = "User registration and authorization for the leap platform"
- s.description = "This this plugin for the leap platform provides user signup and login. It uses Secure Remote Password for the authentication."
-
- s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile"]
- s.test_files = Dir["test/**/*"]
-
- s.add_dependency "leap_web_core", LeapWeb::VERSION
-
- s.add_dependency "ruby-srp", "~> 0.2.1"
- s.add_dependency "rails_warden"
-end
diff --git a/users/lib/leap_web_users.rb b/users/lib/leap_web_users.rb
deleted file mode 100644
index e1b7b1f..0000000
--- a/users/lib/leap_web_users.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require "leap_web_users/engine"
-
-module LeapWebUsers
-end
diff --git a/users/lib/leap_web_users/engine.rb b/users/lib/leap_web_users/engine.rb
deleted file mode 100644
index f8ed71c..0000000
--- a/users/lib/leap_web_users/engine.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# thou shall require all your dependencies in an engine.
-require "leap_web_core"
-require "leap_web_core/ui_dependencies"
-require "rails_warden"
-require "ruby-srp"
-
-require "warden/session_serializer"
-require "warden/strategies/secure_remote_password"
-
-require "webfinger"
-
-module LeapWebUsers
- class Engine < ::Rails::Engine
-
- end
-end
diff --git a/users/script/rails b/users/script/rails
deleted file mode 100755
index ee08520..0000000
--- a/users/script/rails
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env ruby1.8
-# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
-
-ENGINE_ROOT = File.expand_path('../..', __FILE__)
-ENGINE_PATH = File.expand_path('../../lib/leap_web_users/engine', __FILE__)
-
-require 'rails/all'
-require 'rails/engine/commands'
diff --git a/users/test/factories.rb b/users/test/factories.rb
deleted file mode 100644
index ae00d43..0000000
--- a/users/test/factories.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-FactoryGirl.define do
-
- factory :user do
- login { Faker::Internet.user_name }
- password_verifier "1234ABCD"
- password_salt "4321AB"
-
- factory :user_with_settings do
- email_forward { Faker::Internet.email }
- email_aliases_attributes do
- {:a => Faker::Internet.user_name + '@' + APP_CONFIG[:domain]}
- end
- end
-
- factory :admin_user do
- after(:build) do |admin|
- admin.stubs(:is_admin?).returns(true)
- end
- end
- end
-
- factory :token do
- user
- end
-
- factory :pgp_key do
- keyblock <<-EOPGP
------BEGIN PGP PUBLIC KEY BLOCK-----
-+Dummy+PGP+KEY+++Dummy+PGP+KEY+++Dummy+PGP+KEY+++Dummy+PGP+KEY+
-#{SecureRandom.base64(4032)}
------END PGP PUBLIC KEY BLOCK-----
- EOPGP
- end
-end
diff --git a/users/test/fixtures/.gitkeep b/users/test/fixtures/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/users/test/fixtures/.gitkeep
+++ /dev/null
diff --git a/users/test/functional/.gitkeep b/users/test/functional/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/users/test/functional/.gitkeep
+++ /dev/null
diff --git a/users/test/integration/.gitkeep b/users/test/integration/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/users/test/integration/.gitkeep
+++ /dev/null
diff --git a/users/test/integration/navigation_test.rb b/users/test/integration/navigation_test.rb
deleted file mode 100644
index eec8c0e..0000000
--- a/users/test/integration/navigation_test.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require 'test_helper'
-
-class NavigationTest < ActionDispatch::IntegrationTest
-
- # test "the truth" do
- # assert true
- # end
-end
-
diff --git a/users/test/test_helper.rb b/users/test/test_helper.rb
deleted file mode 100644
index 52dff53..0000000
--- a/users/test/test_helper.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-ENV["RAILS_ENV"] = "test"
-require File.expand_path('../../../test/dummy/config/environment', __FILE__)
-require 'rails/test_help'
-require 'mocha/setup'
-
-Rails.backtrace_cleaner.remove_silencers!
-
-# Load support files
-Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
diff --git a/users/test/unit/.gitkeep b/users/test/unit/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/users/test/unit/.gitkeep
+++ /dev/null
diff --git a/users/test/unit/email_test.rb b/users/test/unit/email_test.rb
deleted file mode 100644
index 7cfbc84..0000000
--- a/users/test/unit/email_test.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require 'test_helper'
-
-class EmailTest < ActiveSupport::TestCase
-
- test "valid format" do
- email = Email.new(email_string)
- assert email.valid?
- end
-
- test "validates format" do
- email = Email.new("email")
- assert !email.valid?
- assert_equal ["needs to be a valid email address"], email.errors[:email]
- end
-
- def email_string
- @email_string ||= Faker::Internet.email
- end
-end