Skip to content

Load ensuring for documents should poll on the url #53

@ghost

Description

For Documents, the 2 load ensuring checks are implement via the following:

In Concerns::LoadEnsuring

      def ensure_loaded!
        if locator = loaded_locator
          find(*eval_locator(locator)) 
        end

        self
      rescue Capybara::ElementNotFound => e
        raise LoadingFailed, e.message 
      end

In Concerns::Visitable

      def ensure_loaded!
        unless self.class.can_load_from_current_url?
          raise LoadingFailed, "#{self.class.name} cannot be loaded with url '#{current_url_without_params}'"
        end

        super
      end

The Visitable method is called first. This method will fail immediately if the URL does match the path. Instead, this code should poll on the URL. This is necessary for JS redirects whereby JS code sets the window.location property.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions