2015-01-19 14:18:00 -05:00
|
|
|
class Spinach::Features::AdminApplications < Spinach::FeatureSteps
|
|
|
|
include SharedAuthentication
|
|
|
|
include SharedPaths
|
|
|
|
include SharedAdmin
|
|
|
|
|
|
|
|
step 'I click on new application button' do
|
|
|
|
click_on 'New Application'
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I should see application form' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content "New application"
|
2015-01-19 14:18:00 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I fill application form out and submit' do
|
|
|
|
fill_in :doorkeeper_application_name, with: 'test'
|
|
|
|
fill_in :doorkeeper_application_redirect_uri, with: 'https://test.com'
|
|
|
|
click_on "Submit"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I see application' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content "Application: test"
|
|
|
|
expect(page).to have_content "Application Id"
|
|
|
|
expect(page).to have_content "Secret"
|
2015-01-19 14:18:00 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I click edit' do
|
|
|
|
click_on "Edit"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I see edit application form' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content "Edit application"
|
2015-01-19 14:18:00 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I change name of application and submit' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content "Edit application"
|
2015-01-19 14:18:00 -05:00
|
|
|
fill_in :doorkeeper_application_name, with: 'test_changed'
|
|
|
|
click_on "Submit"
|
|
|
|
end
|
|
|
|
|
|
|
|
step 'I see that application was changed' do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page).to have_content "test_changed"
|
|
|
|
expect(page).to have_content "Application Id"
|
|
|
|
expect(page).to have_content "Secret"
|
2015-01-19 14:18:00 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I click to remove application' do
|
2015-06-12 01:36:00 -04:00
|
|
|
page.within '.oauth-applications' do
|
2015-01-19 14:18:00 -05:00
|
|
|
click_on "Destroy"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
step "I see that application is removed" do
|
2015-06-12 00:44:13 -04:00
|
|
|
expect(page.find(".oauth-applications")).not_to have_content "test_changed"
|
2015-01-19 14:18:00 -05:00
|
|
|
end
|
|
|
|
end
|