Mobile authorizations index view

This commit is contained in:
Raphael Sofaer 2011-08-11 16:39:39 -07:00
parent 7f69714d08
commit 9a77d3518f
2 changed files with 29 additions and 1 deletions

View file

@ -0,0 +1,24 @@
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
%h3
= t('_applications')
#applications_stream.stream
- if @applications.count > 0
- for app in @applications
.stream_element{:id => app.id}
.right
= link_to t('.revoke_access'), authorization_path(:id => app.id), :method => :delete, :confirm => 'are you sure?', :class => "button"
- if app.icon_url
= image_tag(app.application_base_url + app.icon_url, :class => "avatar")
.content
%div.from
= link_to app.name, app.application_base_url
= app.description
- else
You haven't registered any applications yet.
%br

View file

@ -81,7 +81,7 @@ describe AuthorizationsController do
post :token, @params_hash post :token, @params_hash
response.code.should == "200" response.code.should == "200"
end end
it 'renders something for localhost' do it 'renders something for localhost' do
prepare_manifest("http://localhost:3423/") prepare_manifest("http://localhost:3423/")
@controller.stub!(:verify).and_return('ok') @controller.stub!(:verify).and_return('ok')
@ -133,6 +133,10 @@ describe AuthorizationsController do
get :index get :index
response.should be_success response.should be_success
end end
it 'succeeds on a phone' do
get :index, :format => :mobile
response.should be_success
end
it 'assigns the auth. & apps for the current user' do it 'assigns the auth. & apps for the current user' do
app1 = Factory.create(:app, :name => "Authorized App") app1 = Factory.create(:app, :name => "Authorized App")