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

Add expectation for the current path #96

Merged
merged 1 commit into from
Oct 2, 2020
Merged

Add expectation for the current path #96

merged 1 commit into from
Oct 2, 2020

Conversation

matthewmcgarvey
Copy link
Member

@matthewmcgarvey matthewmcgarvey commented Oct 2, 2020

Fixes #94

This allows us to write specs like

it "requires signed in users" do
  flow = BaseFlow.new
  flow.visit Authenticated::Endpoint::Index
  flow.should have_current_path(SignIn::New)
end

Copy link
Member

@jwoertink jwoertink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I dig it.

@jwoertink jwoertink merged commit ce163cf into luckyframework:master Oct 2, 2020
@matthewmcgarvey matthewmcgarvey deleted the have-current-path branch October 2, 2020 22:08
Copy link
Member

@paulcsmith paulcsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super cool! Nice idea and implementation

@@ -9,6 +9,7 @@ describe LuckyFlow do

flow.el("@heading", text: "Home").should be_on_page
flow.el("@heading").should have_text("Home")
flow.should have_current_path("/home")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to come in late, but could you make a PR that also tests with a Lucky::Action class to make sure the other two method overloads work?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't write a test for those because this library doesn't actually depend on lucky. If I called those methods it would fail to compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an expectation for asserting the current path
3 participants