-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from angiecstn/rsc_create_hospitals
RSC can create hospitals
- Loading branch information
Showing
13 changed files
with
57 additions
and
11 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 |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
|
||
# Ignore uploaded files in development | ||
/storage/* | ||
|
||
.DS_Store | ||
/node_modules | ||
/yarn-error.log | ||
|
||
|
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
class Hospital < ApplicationRecord | ||
validates_presence_of :name | ||
validates :name, uniqueness: true | ||
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
var templateContent = '<%= escape_javascript(render partial: 'index') %>' | ||
displayTemplate(templateContent) | ||
displayTemplate(templateContent) |
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
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,25 @@ | ||
@javascript | ||
|
||
Feature: RSC creates a new hospital | ||
As a RSC, | ||
In order to create hospitals, | ||
I would like to access the dashboard, click on the “Hospitals” button and fill in the hospital name. | ||
|
||
Background: | ||
Given the following hospitals exists | ||
| name | | ||
| Hospital 2 | | ||
Given I am on the landing page | ||
And I click on "Hospitals" | ||
|
||
Scenario: RSC can successfully add new hospitals | ||
And I fill in "Name" with "Hospital 3" | ||
And I click on "Add Hospital" | ||
And I should see "Hospital added" | ||
Then I should see "Hospital 3" | ||
|
||
Scenario: RSC cannot add hospitals if it already exists | ||
And I fill in "Name" with "Hospital 2" | ||
And I click on "Add Hospital" | ||
Then I should see "Hospital already exists. Your hospital could not be saved" | ||
|
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