This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Changing user details | |
Scenario: Changing first name to Bob | |
Given I register a new user called "Brian" | |
When I change their "name" to "Bob" | |
Then their "name" should be "Bob" | |
Scenario: Changing first name to Charlie | |
Given I register a new user called "Roberto" | |
When I change their "name" to "Charlie" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule GherkinTests.Contexts.EditUser do | |
use WhiteBread.Context | |
given_ ~r/^I register a new user called "(?<name>[^"]+)"$/, | |
fn state, %{name: name} -> | |
user_details = %{name: name, email: "#{name}@example.com", password: "password123"} | |
user_id = MyApp.register(user_details) | |
state = Map.put(state, :user_id, user_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Changing user details | |
Scenario: Changing first name to Bob | |
Given I register a new user called "Brian" | |
When I change their name to "Bob" | |
Then their name should be "Bob" | |
Scenario: Changing first name to Charlie | |
Given I register a new user called "Roberto" | |
When I change their name to "Charlie" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule GherkinTests.Contexts.EditUser do | |
use WhiteBread.Context | |
given_ ~r/^I register a new user called Brian$/, | |
fn state -> | |
user_details = %{name: "Brian", email: "brian@example.com", password: "password123"} | |
user_id = MyApp.register(user_details) | |
state = Map.put(state, :user_id, user_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Changing user details | |
Scenario: Changing first name to Bob | |
Given I register a new user called Brian | |
When I change their name to Bob | |
Then their name should be Bob | |
Scenario: Changing first name to Charlie | |
Given I register a new user called Roberto | |
When I change their name to Charlie |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule GherkinTests.Contexts.AddUser do | |
use WhiteBread.Context | |
subcontext GherkinTests.Contexts.Nothing | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule GherkinTests.Contexts.Nothing do | |
use WhiteBread.Context | |
given_ ~r/^nothing/, | |
fn state -> | |
{:ok, state} | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule GherkinTests.Config do | |
use WhiteBread.SuiteConfiguration | |
suite name: "Add User", | |
context: GherkinTests.Contexts.AddUser, | |
feature_paths: ["features/add_user.feature"] | |
suite name: "Delete User", | |
context: GherkinTests.Contexts.DeleteUser, | |
feature_paths: ["features/delete_user.feature"] |
NewerOlder