Skip to content

Commit

Permalink
Merge pull request #4917 from hpetru/4806-new-status_messages-page
Browse files Browse the repository at this point in the history
Redirect to stream_path if is destkop
  • Loading branch information
jhass committed Apr 8, 2014
2 parents 682a496 + 2311b76 commit 66c5111
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Expand Up @@ -33,6 +33,7 @@
* Don't cut off long tags in stream posts [#4864](https://github.com/diaspora/diaspora/issues/4864)
* Do not replace earlier appearances of the name while mentioning somebody [#4868](https://github.com/diaspora/diaspora/issues/4868)
* Catch exceptions when trying to decode an invalid URI [#4874](https://github.com/diaspora/diaspora/issues/4874)
* Redirect to the stream when switching the mobile publisher to desktop [#4806](https://github.com/diaspora/diaspora/issues/4806)

## Features
* You can report a single post by clicking the correct icon in the controler section [#4517](https://github.com/diaspora/diaspora/pull/4517)
Expand Down
6 changes: 4 additions & 2 deletions app/controllers/status_messages_controller.rb
Expand Up @@ -29,11 +29,13 @@ def new
@contacts_of_contact = @contact.contacts
render :layout => nil
end
else
elsif(request.format == :mobile)
@aspect = :all
@aspects = current_user.aspects
@aspect_ids = @aspects.map{ |a| a.id }
gon.aspect_ids = @aspect_ids
else
redirect_to stream_path
end
end

Expand Down Expand Up @@ -125,4 +127,4 @@ def normalize_public_flag!
def remove_getting_started
current_user.disable_getting_started
end
end
end
5 changes: 5 additions & 0 deletions spec/controllers/status_messages_controller_spec.rb
Expand Up @@ -58,6 +58,11 @@ def pass_test_args(text='cute kitty')
response.should be_success
end

it 'should redirect on desktop version' do
get :new
response.should redirect_to(stream_path)
end

it 'generates a jasmine fixture', :fixture => true do
contact = alice.contact_for(bob.person)
aspect = alice.aspects.create(:name => 'people')
Expand Down

0 comments on commit 66c5111

Please sign in to comment.