|
|
@ -47,13 +47,13 @@ describe Settings::ApplicationsController do
|
|
|
|
context 'success (passed scopes as a String)' do
|
|
|
|
context 'success (passed scopes as a String)' do
|
|
|
|
def call_create
|
|
|
|
def call_create
|
|
|
|
post :create, params: {
|
|
|
|
post :create, params: {
|
|
|
|
doorkeeper_application: {
|
|
|
|
doorkeeper_application: {
|
|
|
|
name: 'My New App',
|
|
|
|
name: 'My New App',
|
|
|
|
redirect_uri: 'urn:ietf:wg:oauth:2.0:oob',
|
|
|
|
redirect_uri: 'urn:ietf:wg:oauth:2.0:oob',
|
|
|
|
website: 'http://google.com',
|
|
|
|
website: 'http://google.com',
|
|
|
|
scopes: 'read write follow'
|
|
|
|
scopes: 'read write follow'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
response
|
|
|
|
response
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -69,13 +69,13 @@ describe Settings::ApplicationsController do
|
|
|
|
context 'success (passed scopes as an Array)' do
|
|
|
|
context 'success (passed scopes as an Array)' do
|
|
|
|
def call_create
|
|
|
|
def call_create
|
|
|
|
post :create, params: {
|
|
|
|
post :create, params: {
|
|
|
|
doorkeeper_application: {
|
|
|
|
doorkeeper_application: {
|
|
|
|
name: 'My New App',
|
|
|
|
name: 'My New App',
|
|
|
|
redirect_uri: 'urn:ietf:wg:oauth:2.0:oob',
|
|
|
|
redirect_uri: 'urn:ietf:wg:oauth:2.0:oob',
|
|
|
|
website: 'http://google.com',
|
|
|
|
website: 'http://google.com',
|
|
|
|
scopes: [ 'read', 'write', 'follow' ]
|
|
|
|
scopes: [ 'read', 'write', 'follow' ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
response
|
|
|
|
response
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -91,13 +91,13 @@ describe Settings::ApplicationsController do
|
|
|
|
context 'failure' do
|
|
|
|
context 'failure' do
|
|
|
|
before do
|
|
|
|
before do
|
|
|
|
post :create, params: {
|
|
|
|
post :create, params: {
|
|
|
|
doorkeeper_application: {
|
|
|
|
doorkeeper_application: {
|
|
|
|
name: '',
|
|
|
|
name: '',
|
|
|
|
redirect_uri: '',
|
|
|
|
redirect_uri: '',
|
|
|
|
website: '',
|
|
|
|
website: '',
|
|
|
|
scopes: []
|
|
|
|
scopes: []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
it 'returns http success' do
|
|
|
|
it 'returns http success' do
|
|
|
@ -120,9 +120,9 @@ describe Settings::ApplicationsController do
|
|
|
|
|
|
|
|
|
|
|
|
def call_update
|
|
|
|
def call_update
|
|
|
|
patch :update, params: {
|
|
|
|
patch :update, params: {
|
|
|
|
id: app.id,
|
|
|
|
id: app.id,
|
|
|
|
doorkeeper_application: opts
|
|
|
|
doorkeeper_application: opts
|
|
|
|
}
|
|
|
|
}
|
|
|
|
response
|
|
|
|
response
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -139,14 +139,14 @@ describe Settings::ApplicationsController do
|
|
|
|
context 'failure' do
|
|
|
|
context 'failure' do
|
|
|
|
before do
|
|
|
|
before do
|
|
|
|
patch :update, params: {
|
|
|
|
patch :update, params: {
|
|
|
|
id: app.id,
|
|
|
|
id: app.id,
|
|
|
|
doorkeeper_application: {
|
|
|
|
doorkeeper_application: {
|
|
|
|
name: '',
|
|
|
|
name: '',
|
|
|
|
redirect_uri: '',
|
|
|
|
redirect_uri: '',
|
|
|
|
website: '',
|
|
|
|
website: '',
|
|
|
|
scopes: []
|
|
|
|
scopes: []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
it 'returns http success' do
|
|
|
|
it 'returns http success' do
|
|
|
|