---
src/app/views/realms/_mapping.haml | 4 ++--
src/app/views/realms/show.haml | 4 ++--
src/features/realm.feature | 28 ++++++++++++++--------------
3 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/src/app/views/realms/_mapping.haml b/src/app/views/realms/_mapping.haml
index dfdbdbb..1a57359 100644
--- a/src/app/views/realms/_mapping.haml
+++ b/src/app/views/realms/_mapping.haml
@@ -1,6 +1,6 @@
- form_tag multi_destroy_realm_mappings_path(:frontend_realm_id => @realm.id) do
- = link_to "Add mapping to realm", new_realm_mapping_path(:frontend_realm_id => @realm.id, :realm_or_provider_type => 'Realm'), :class => "button"
- = link_to "Add mapping to provider", new_realm_mapping_path(:frontend_realm_id => @realm.id, :realm_or_provider_type => 'Provider'), :class => "button"
+ = link_to "Add mapping to realm", new_realm_mapping_path(:frontend_realm_id => @realm.id, :realm_or_provider_type => 'Realm'), :class => "button", :id => 'mapping_to_realm_button'
+ = link_to "Add mapping to provider", new_realm_mapping_path(:frontend_realm_id => @realm.id, :realm_or_provider_type => 'Provider'), :class => "button", :id => 'mapping_to_provider_button'
= submit_tag "Delete", :id => 'delete_button', :class => 'button danger'
diff --git a/src/app/views/realms/show.haml b/src/app/views/realms/show.haml
index e98f814..2368ee0 100644
--- a/src/app/views/realms/show.haml
+++ b/src/app/views/realms/show.haml
@@ -4,8 +4,8 @@
#obj_actions.button-container
= link_to 'New Realm', new_realm_url, :class => 'button primary', :id => 'new_realm_button'
.button-group
- = link_to 'Edit', edit_realm_path(@realm), :class => 'button pill'
- = button_to 'Delete', realm_path(@realm), :method => :delete, :confirm => "Are you sure you want to delete?", :class => 'button pill danger'
+ = link_to 'Edit', edit_realm_path(@realm), :class => 'button pill', :id => 'edit_realm_button'
+ = button_to 'Delete', realm_path(@realm), :method => :delete, :confirm => "Are you sure you want to delete?", :class => 'button pill danger', :id => 'delete_realm_button'
.corner
%section.content-section.realm
diff --git a/src/features/realm.feature b/src/features/realm.feature
index a4936af..70ddc90 100644
--- a/src/features/realm.feature
+++ b/src/features/realm.feature
@@ -11,19 +11,19 @@ Feature: Manage Realms
Scenario: Create new frontend realm
Given I am on the realms page
- When I follow "New Realm"
+ When I follow "new_realm_button"
Then I should see "Create a new Realm"
- When I fill in "frontend_realm[name]" with "testrealm2"
+ When I fill in "frontend_realm_name" with "testrealm2"
And I press "Save"
Then I should see "Realm was added."
Scenario: Validate unique frontend realm name
Given I am on the realms page
And there is a realm "testrealm1"
- When I follow "New Realm"
+ When I follow "new_realm_button"
Then I should see "Create a new Realm"
- When I fill in "frontend_realm[name]" with "testrealm1"
- And I press "Save"
+ When I fill in "frontend_realm_name" with "testrealm1"
+ And I press "frontend_realm_submit"
Then I should see "Name has already been taken"
Scenario: Add realm mapping
@@ -31,9 +31,9 @@ Feature: Manage Realms
And there is a realm "testrealm1"
And a provider "provider1" exists
When I follow "testrealm1"
- And I follow "Add mapping to provider"
+ And I follow "mapping_to_provider_button"
Then I should see "Create a new Realm Mapping"
- When I press "Save"
+ When I press "realm_backend_target_submit"
Then I should see "Realm mapping was added."
Scenario: Add a realm mapping w/o selecting backend target
@@ -41,19 +41,19 @@ Feature: Manage Realms
And there is a realm "testrealm1"
And there is no provider
When I follow "testrealm1"
- And I follow "Add mapping to provider"
+ And I follow "mapping_to_provider_button"
Then I should see "Create a new Realm Mapping"
- When I press "Save"
+ And I press "realm_backend_target_submit"
Then I should see "Realm or provider can't be blank"
Scenario: Change the name
Given I am on the realms page
And there is a realm "testrealm1"
When I follow "testrealm1"
- And I follow "Edit"
+ And I follow "edit_realm_button"
Then I should see "Properties"
- When I fill in "frontend_realm[name]" with "testrealm2"
- And I press "Save"
+ When I fill in "frontend_realm_name" with "testrealm2"
+ And I press "frontend_realm_submit"
Then I should see "Realm updated successfully!"
Scenario: Show realm detials
@@ -68,14 +68,14 @@ Feature: Manage Realms
And there are 2 realms
When I check "testrealm2" realm
And I check "testrealm1" realm
- And I press "Delete"
+ And I press "delete_button"
Then there should be only 0 realms
And I should be on the realms page
And I should see "These Realms were deleted: testrealm1, testrealm2"
Scenario: Delete realm without selecting one
Given I am on the realms page
- When I press "Delete"
+ When I press "delete_button"
Then I should be on the realms page
And I should see "You must select at least one realm to delete."
--
1.7.4.4