-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle BOM. Also fix regexp for hyphenated languages. Fixes #144.
- Loading branch information
1 parent
0615b9e
commit bb60dbb
Showing
4 changed files
with
75 additions
and
23 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
Feature: User logs into the system | ||
In order to be able to use eraNET components | ||
As a user | ||
I want to log in to the system | ||
|
||
|
||
Scenario: Unlogged user sees welcome page with login | ||
Given I have not logged or have logged out before | ||
When I visit initial page | ||
Then Default app should be loaded | ||
And I should see login request | ||
And I should not see any username | ||
|
||
|
||
Scenario: Minimal user sees welcome page with its username and logout | ||
Given I have logged as guest named "Guest" | ||
When I visit initial page | ||
Then Default app should be loaded | ||
And I should see logout request | ||
And I should see "Guest" as username | ||
|
||
|
||
Scenario: Unlogged user logs in | ||
Given I have not logged or have logged out before | ||
And I have visited initial page | ||
And I have seen login request | ||
When I ask to log in | ||
Then I should be taken to login page | ||
|
||
|
||
Scenario: Logged user logs out | ||
Given I have logged as guest named "Guest" | ||
And I have visited initial page | ||
And I have seen logout request | ||
When I ask to log out | ||
Then I should be taken to logout page | ||
|
||
|
||
Scenario: Disconnected user sees welcome page and reconnect option | ||
Given I have had a broken connection with api site | ||
When I visit initial page | ||
Then Default app should be loaded | ||
And I should see reconnect request | ||
And I should not see any username | ||
|
||
|
||
Scenario: User sees 'connecting' while connecting | ||
Given I have had lagging api site | ||
When I visit initial page | ||
Then I should see connecting message | ||
And I should not see any username | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var gherkin = require('gherkin'); | ||
|
||
/** | ||
* Small wrapper around Gherkin that strips BOM and loads the correct lexer based | ||
* on the language header. | ||
*/ | ||
module.exports = function GherkinLexer(content, gherkinListener) { | ||
// Strip BOM | ||
content = content.replace(/^\ufeff/g, ''); | ||
|
||
var languageMatch = /^\s*#\s*language:\s*([a-zA-Z-]+)\s*$/m.exec(content); | ||
var language = languageMatch == null ? 'en' : languageMatch[1].toLowerCase(); | ||
var Lexer = gherkin.Lexer(language); | ||
var lexer = new Lexer(gherkinListener); | ||
|
||
this.scan = function() { | ||
lexer.scan(content); | ||
} | ||
}; |
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
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
bb60dbb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Aslak. Unfortunately, this commit broke the build.
bb60dbb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that. I thought all tests were passing locally. Investigating...
bb60dbb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by 4ac467e
bb60dbb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ace! thanks