Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy routes/controllers/views/tests from auth_devise #172

Merged

Commits on Aug 10, 2021

  1. [BREAKS BUILD] Copy feature specs from solidus_auth_devise

    solidus_auth_devise commit version was
    c03ca9a2a9eb1fa6e4421aff7b483c502f7151e0.
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    969f182 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f727619 View commit details
    Browse the repository at this point in the history
  3. Remove skipped spec

    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    ff667d5 View commit details
    Browse the repository at this point in the history
  4. Copy solidus_auth_devise frontend routes

    Fixes
    
    ```
      1) Accounts editing can edit an admin user
         Failure/Error: visit spree.login_path
    
         NoMethodError:
           undefined method `login_path' for #<Module:0x0000563aafaae480>
         # ./spec/features/account_spec.rb:7:in `block (3 levels) in <top (required)>'
    ```
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    1b35df8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e34e9e6 View commit details
    Browse the repository at this point in the history
  6. Add solidus_auth_devise

    Fixes
    
    ```
      An error occurred while loading spec_helper.
      Failure/Error: Rails.application.initialize!
    
      NoMethodError:
        undefined method `devise_for' for #<ActionDispatch::Routing::Mapper:0x000055986b023a60>
      # ./config/routes.rb:6:in `block in <top (required)>'
      # ./config/routes.rb:3:in `<top (required)>'
      # ./spec/dummy/config/environment.rb:5:in `<top (required)>'
      # ./spec/spec_helper.rb:15:in `require'
      # ./spec/spec_helper.rb:15:in `<top (required)>'
    ```
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    6245ee4 View commit details
    Browse the repository at this point in the history
  7. Copy solidus_auth_devise controllers

    Fixes
    
    ```
        An error occurred while loading spec_helper.
        Failure/Error: Spree::UserConfirmationsController,
    
        NameError:
          uninitialized constant Spree::UserConfirmationsController
        # ./lib/solidus_starter_frontend/engine.rb:20:in `block in <class:Engine>'
        # ./spec/dummy/config/environment.rb:5:in `<top (required)>'
        # ./spec/spec_helper.rb:15:in `require'
        # ./spec/spec_helper.rb:15:in `<top (required)>'
    ```
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    544e8d0 View commit details
    Browse the repository at this point in the history
  8. Remove frontend_available? monkeypatch

    solidus_starter_frontend will be loading the authentication frontend
    so we no longer want solidus_auth_devise to load it again.
    
    Fixes
    
    ```
        An error occurred while loading spec_helper.
        Failure/Error: Rails.application.initialize!
    
        ArgumentError:
          Invalid route name, already in use: 'new_spree_user_session'
          You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained here:
          https://guides.rubyonrails.org/routing.html#restricting-the-routes-created
        # ./spec/dummy/config/environment.rb:5:in `<top (required)>'
        # ./spec/spec_helper.rb:15:in `require'
        # ./spec/spec_helper.rb:15:in `<top (required)>'
    ```
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    7ba6cbf View commit details
    Browse the repository at this point in the history
  9. Qualify Password field identifiers

    Fixes
    
    ```
      1) Accounts editing can edit a new user
         Failure/Error: fill_in 'Password', with: 'password'
    
         Capybara::Ambiguous:
           Ambiguous match, found 2 elements matching visible field "Password" that is not disabled
         # ./spec/features/account_spec.rb:22:in `block (3 levels) in <top (required)>'
    ```
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    479172f View commit details
    Browse the repository at this point in the history
  10. Move views from lib to app

    Remove AuthViews concern since it's no longer needed.
    
    Fixes
    
    ```
      1) Accounts editing can edit a new user
         Failure/Error: click_link 'Edit'
    
         AbstractController::ActionNotFound:
           The action 'edit' could not be found for Spree::UsersController
         # ./spec/features/account_spec.rb:28:in `block (3 levels) in <top (required)>'
    ```
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    5d2db51 View commit details
    Browse the repository at this point in the history
  11. Update Edit Account form field identifiers

    Fixes
    
    ```
      1) Change email work with correct password
         Failure/Error: fill_in 'user_email', with: '[email protected]'
    
         Capybara::ElementNotFound:
           Unable to find field "user_email" that is not disabled
         # ./spec/features/change_email_spec.rb:19:in `block (2 levels) in <top (required)>'
    ```
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    9b287a7 View commit details
    Browse the repository at this point in the history
  12. Inline solidus_auth_devise CheckoutControllerDecorator to CheckoutCon…

    …troller
    
    Fixes
    
    ```
      1) Checkout leaving and returning to address step
         Failure/Error:
           within '#guest_checkout' do
             fill_in 'Email', with: '[email protected]'
           end
    
         Capybara::ElementNotFound:
           Unable to find css "#guest_checkout"
         # ./spec/features/checkout_spec.rb:36:in `block (2 levels) in <top (required)>'
    ```
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    f86dd85 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    8af71c1 View commit details
    Browse the repository at this point in the history
  14. Copy FillAddressFields

    Fixes
    
    ```
      1) Checkout without payment being required allow a visitor to checkout as guest, without registration
         Failure/Error: fill_addresses_fields_with(address)
    
         NoMethodError:
           undefined method `fill_addresses_fields_with' for #<RSpec::ExampleGroups::Checkout::WithoutPaymentBeingRequired:0x00007f8714d278d0>
         # ./spec/features/checkout_spec.rb:63:in `block (3 levels) in <top (required)>'
    ```
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    75f0cf4 View commit details
    Browse the repository at this point in the history
  15. Copy solidus_auth_devise UserMailer with views

    Fixes
    
    ```
      1) Checkout without payment being required associate an incomplete guest order with user after successful password reset
         Got 0 failures and 2 other errors:
    
         1.1) Failure/Error: token = token_url_regex.match(reset_password_email.body.to_s)[1]
    
              NoMethodError:
                undefined method `body' for nil:NilClass
              # ./spec/features/checkout_spec.rb:115:in `block (3 levels) in <top (required)>'
    
         1.2) Failure/Error: self.resource = resource_class.send_reset_password_instructions(params[resource_name])
    
              ActionView::MissingTemplate:
                Missing template spree/user_mailer/reset_password_instructions with "mailer". Searched in:
                  * "spree/user_mailer"
              # ./app/controllers/spree/user_passwords_controller.rb:19:in `create'
              # ------------------
              # --- Caused by: ---
              # Capybara::CapybaraError:
              #   Your application server raised an error - It has been raised in your test code because Capybara.raise_server_errors == true
              #   /home/gsmendoza/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/capybara-3.35.3/lib/capybara/session.rb:160:in `raise_server_error!'
    ```
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    30d1119 View commit details
    Browse the repository at this point in the history
  16. Fix spec "allow a user to register during checkout"

    Fixes
    
    ```
      1) Checkout without payment being required allow a user to register during checkout
         Failure/Error: expect(page).to have_text 'Registration'
           expected to find text "Registration" in "Search\nLOGIN\nCART: (1) $19.99\nLogin as Existing Customer\nEmail:\nPassword:\nRemember me\nLogin\nor Create a new account | Forgot Password?\nCheckout as a Guest\nEmail:\nContinue\nor Create a new account\nPowered by Solidus\nLanguage:\nCastellano (ES)\nCatalà\nDanish\nDeutsch (DE)\nDeutsch (Schweiz)\nEesti keel\nEnglish (Australia)\nEnglish (IN)\nEnglish (New Zealand)\nEnglish (UK)\nEnglish (US)\nEspañol\nEspañol (Chile)\nEspañol (México)\nFrançais (FR)\nIndonesian (ID)\nItaliano (IT)\nLatvijas (LV)\nNederlands (NL)\nNorsk\nPolski (PL)\nPortuguês (BR)\nPortuguês (PT)\nRomanian (RO)\nSlovenčina\nSlovenščina (SL)\nSuomi\nSvenska (SE)\nTürkçe (TR)\nUkrainian\ntiếng Việt (VN)\nČeština (CS)\nБългарски (БГ)\nРусский (RU)\nفارسی(fa)\nภาษาไทย (TH)\n中文 (繁體)\n中文(简体)\n日本語 (ja-JP)\n한국어 (KO)"
         # ./spec/features/checkout_spec.rb:136:in `block (3 levels) in <top (required)>'
    ```
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    7a73d89 View commit details
    Browse the repository at this point in the history
  17. Fix "Sign In let a user sign in successfully" spec

    Fixes
    
    ```
      1) Sign In let a user sign in successfully
         Failure/Error: expect(page).to have_text 'Logout'
           expected to find text "Logout" in "All departments Search\nMy Account\nCart\nLogged in successfully\nThe only eCommerce platform you’ll ever need.\nBuild, customize and scale your store with no limits or license fees. Solidus is the free, open-source eCommerce framework for digitally-native brands, fast-growing online businesses and pragmatic developers.\nNo products found\nPowered by Solidus\nLanguage: Castellano (ES) Català Danish Deutsch (DE) Deutsch (Schweiz) Eesti keel English (Australia) English (IN) English (New Zealand) English (UK) English (US) Español Español (Chile) Español (México) Français (FR) Indonesian (ID) Italiano (IT) Latvijas (LV) Nederlands (NL) Norsk Polski (PL) Português (BR) Português (PT) Romanian (RO) Slovenčina Slovenščina (SL) Suomi Svenska (SE) Türkçe (TR) Ukrainian tiếng Việt (VN) Čeština (CS) Български (БГ) Русский (RU) فارسی(fa) ภาษาไทย (TH) 中文 (繁體) 中文(简体) 日本語 (ja-JP) 한국어 (KO)"
         # ./spec/features/sign_in_spec.rb:16:in `block (2 levels) in <top (required)>'
    
    ```
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    bc668ce View commit details
    Browse the repository at this point in the history
  18. Copy unauthorized_redirect from solidus_auth_devise

    Fixes "Authorization Failure" error displayed on sign-in.
    
    Fixes
    
    ```
      1) Sign In should store the user previous location
         Failure/Error: fill_in "Email", with: @user.email
    
         Capybara::ElementNotFound:
           Unable to find field "Email" that is not disabled
         # ./spec/features/sign_in_spec.rb:31:in `block (2 levels) in <top (required)>'
    ```
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    c873a10 View commit details
    Browse the repository at this point in the history
  19. Fix 'allow a signed in user to logout' spec

    Fixes
    
    ```
      1) Sign Out allow a signed in user to logout
         Failure/Error: click_link 'Logout'
    
         Capybara::ElementNotFound:
           Unable to find link "Logout"
         # ./spec/features/sign_out_spec.rb:21:in `block (2 levels) in <top (required)>'
    ```
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    f9e1b49 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    3828604 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    b5e0ebb View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    e00751a View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    4ec315b View commit details
    Browse the repository at this point in the history
  24. Include Devise::Test::ControllerHelpers in controller spec

    Fixes
    
    ```
      1) Spree::ProductsController sets the default locale based off SolidusStarterFrontend::Config[:locale]
         Failure/Error: @searcher = build_searcher(params.merge(include_images: true))
    
         Devise::MissingWarden:
           Devise could not find the `Warden::Proxy` instance on your request environment.
           Make sure that your application is loading Devise and Warden as expected and that the `Warden::Manager` middleware is present in your middleware stack.
           If you are seeing this on one of your tests, ensure that your tests are either executing the Rails middleware stack or that your tests are using the `Devise::Test::ControllerHelpers` module to inject the `request.env['warden']` object for you.
         # ./app/controllers/spree/products_controller.rb:13:in `index'
         # ./spec/controllers/controller_helpers_spec.rb:26:in `block (2 levels) in <top (required)>'
    ```
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    4165a32 View commit details
    Browse the repository at this point in the history
  25. [FIXES TEST SUITE] Sign in to request specs using Devise::Test::Integ…

    …rationHelpers
    
    Fixes intermittent system spec failures caused the mocks in the with_signed_in_user handler.
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    58dc7a8 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    0940006 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    40cb474 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    70c3713 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    774c6b7 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    22f0bf5 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    4b1f2ba View commit details
    Browse the repository at this point in the history
  32. Copy controller and mailer specs from solidus_auth_devise

    Include Devise::Test::ControllerHelpers
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    7387c68 View commit details
    Browse the repository at this point in the history
  33. Fix intermittent checkout example

    The example fails frequently. See for example,
    https://app.circleci.com/pipelines/github/nebulab/solidus_starter_frontend/879/workflows/778f9ce5-62d3-43b4-af6b-6e282b275815/jobs/2243/tests.
    In the test run I did in the video below, I got it to fail 40 out of 100
    times.
    
    I discovered that the example fails frequently under the following conditions:
    
    1. When signing in as a guest during checkout.
    2. When using the apparition JS driver.
    
    However, under ANY of these conditions, the example succeeds most of the time:
    
    1. On the current master branch, where we don't have authentication yet.
    2. When signing in as a user during checkout.
    3. When using a different JS driver, like selenium_chrome_headless.
    
    Please see the video below for more details.
    
    https://www.loom.com/share/2a6db47101f24fcd8206361f8300d7f9
    gsmendoza committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    a88dee4 View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    bccabef View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2021

  1. Update comment in checkout controller

    Co-authored-by: Marc Busqué <[email protected]>
    George Mendoza and waiting-for-dev authored Aug 11, 2021
    Configuration menu
    Copy the full SHA
    9746326 View commit details
    Browse the repository at this point in the history