Merge branch 'stable' into develop
This commit is contained in:
commit
4a7c358be9
26 changed files with 113 additions and 124 deletions
|
|
@ -20,6 +20,7 @@ Ruby 2.0 is no longer officially supported.
|
||||||
* Use asset helper instead of .css.erb [#5886](https://github.com/diaspora/diaspora/pull/5886)
|
* Use asset helper instead of .css.erb [#5886](https://github.com/diaspora/diaspora/pull/5886)
|
||||||
* Dropped db/seeds.rb [#5896](https://github.com/diaspora/diaspora/pull/5896)
|
* Dropped db/seeds.rb [#5896](https://github.com/diaspora/diaspora/pull/5896)
|
||||||
* Drop broken install scripts [#5907](https://github.com/diaspora/diaspora/pull/5907)
|
* Drop broken install scripts [#5907](https://github.com/diaspora/diaspora/pull/5907)
|
||||||
|
* Improve invoking mobile site in the testsuite [#5915](https://github.com/diaspora/diaspora/pull/5915)
|
||||||
|
|
||||||
## Bug fixes
|
## Bug fixes
|
||||||
* Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846)
|
* Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846)
|
||||||
|
|
@ -33,6 +34,7 @@ Ruby 2.0 is no longer officially supported.
|
||||||
* Correctly handle IE8 in the chrome frame middleware [#5878](https://github.com/diaspora/diaspora/pull/5878)
|
* Correctly handle IE8 in the chrome frame middleware [#5878](https://github.com/diaspora/diaspora/pull/5878)
|
||||||
* Fix code reloading for PostPresenter [#5888](https://github.com/diaspora/diaspora/pull/5888)
|
* Fix code reloading for PostPresenter [#5888](https://github.com/diaspora/diaspora/pull/5888)
|
||||||
* Fix closing account from mobile view [#5913](https://github.com/diaspora/diaspora/pull/5913)
|
* Fix closing account from mobile view [#5913](https://github.com/diaspora/diaspora/pull/5913)
|
||||||
|
* Allow using common custom template for desktop & mobile landing page [#5915](https://github.com/diaspora/diaspora/pull/5915)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* Hide post title of limited post in comment notification email [#5843](https://github.com/diaspora/diaspora/pull/5843)
|
* Hide post title of limited post in comment notification email [#5843](https://github.com/diaspora/diaspora/pull/5843)
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
# the COPYRIGHT file.
|
# the COPYRIGHT file.
|
||||||
|
|
||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
|
before_action :force_tablet_html
|
||||||
has_mobile_fu
|
has_mobile_fu
|
||||||
protect_from_forgery :except => :receive
|
protect_from_forgery :except => :receive
|
||||||
|
|
||||||
|
|
@ -38,9 +39,7 @@ class ApplicationController < ActionController::Base
|
||||||
|
|
||||||
# Overwriting the sign_out redirect path method
|
# Overwriting the sign_out redirect path method
|
||||||
def after_sign_out_path_for(resource_or_scope)
|
def after_sign_out_path_for(resource_or_scope)
|
||||||
# mobile_fu's is_mobile_device? wasn't working here for some reason...
|
if is_mobile_device?
|
||||||
# it may have been just because of the test env.
|
|
||||||
if request.env['HTTP_USER_AGENT'].try(:match, /mobile/i)
|
|
||||||
root_path
|
root_path
|
||||||
else
|
else
|
||||||
new_user_session_path
|
new_user_session_path
|
||||||
|
|
@ -124,12 +123,13 @@ class ApplicationController < ActionController::Base
|
||||||
def mobile_switch
|
def mobile_switch
|
||||||
if session[:mobile_view] == true && request.format.html?
|
if session[:mobile_view] == true && request.format.html?
|
||||||
request.format = :mobile
|
request.format = :mobile
|
||||||
elsif request.format.tablet?
|
|
||||||
# we currently don't have any special tablet views...
|
|
||||||
request.format = :html
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def force_tablet_html
|
||||||
|
session[:tablet_view] = false
|
||||||
|
end
|
||||||
|
|
||||||
def after_sign_in_path_for(resource)
|
def after_sign_in_path_for(resource)
|
||||||
stored_location_for(:user) || current_user_redirect_path
|
stored_location_for(:user) || current_user_redirect_path
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,17 @@ class HomeController < ApplicationController
|
||||||
partial_dir = Rails.root.join("app", "views", "home")
|
partial_dir = Rails.root.join("app", "views", "home")
|
||||||
if user_signed_in?
|
if user_signed_in?
|
||||||
redirect_to stream_path
|
redirect_to stream_path
|
||||||
elsif is_mobile_device?
|
elsif request.format == :mobile
|
||||||
if partial_dir.join("_show.mobile.haml").exist? ||
|
if partial_dir.join("_show.mobile.haml").exist? ||
|
||||||
partial_dir.join("_show.mobile.erb").exist?
|
partial_dir.join("_show.mobile.erb").exist? ||
|
||||||
|
partial_dir.join("_show.haml").exist?
|
||||||
render :show
|
render :show
|
||||||
else
|
else
|
||||||
redirect_to user_session_path
|
redirect_to user_session_path
|
||||||
end
|
end
|
||||||
elsif partial_dir.join("_show.html.haml").exist? ||
|
elsif partial_dir.join("_show.html.haml").exist? ||
|
||||||
partial_dir.join("_show.html.erb").exist?
|
partial_dir.join("_show.html.erb").exist? ||
|
||||||
|
partial_dir.join("_show.haml").exist?
|
||||||
render :show
|
render :show
|
||||||
else
|
else
|
||||||
render :default,
|
render :default,
|
||||||
|
|
|
||||||
|
|
@ -6,4 +6,4 @@
|
||||||
- content_for :page_title do
|
- content_for :page_title do
|
||||||
= pod_name
|
= pod_name
|
||||||
|
|
||||||
= render :partial => 'home/show'
|
= render partial: "home/show"
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
|
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
|
||||||
-# the COPYRIGHT file.
|
|
||||||
|
|
||||||
|
|
||||||
=render :partial => 'home/show' rescue "put something in app/views/home/_show.html"
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
@javascript
|
@javascript @mobile
|
||||||
Feature: Viewing my activity on the steam mobile page
|
Feature: Viewing my activity on the steam mobile page
|
||||||
In order to navigate Diaspora*
|
In order to navigate Diaspora*
|
||||||
As a mobile user
|
As a mobile user
|
||||||
|
|
@ -7,7 +7,6 @@ Feature: Viewing my activity on the steam mobile page
|
||||||
Background:
|
Background:
|
||||||
Given a user with username "alice"
|
Given a user with username "alice"
|
||||||
And "alice@alice.alice" has a public post with text "Hello! I am #newhere"
|
And "alice@alice.alice" has a public post with text "Hello! I am #newhere"
|
||||||
When I toggle the mobile view
|
|
||||||
And I sign in as "alice@alice.alice" on the mobile website
|
And I sign in as "alice@alice.alice" on the mobile website
|
||||||
|
|
||||||
Scenario: Show my activity empty
|
Scenario: Show my activity empty
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
@javascript
|
@javascript @mobile
|
||||||
Feature: Close account
|
Feature: Close account
|
||||||
In order to close an existing account
|
In order to close an existing account
|
||||||
As a user
|
As a user
|
||||||
|
|
@ -6,8 +6,7 @@ Feature: Close account
|
||||||
|
|
||||||
Scenario: user closes account
|
Scenario: user closes account
|
||||||
Given I am signed in
|
Given I am signed in
|
||||||
When I toggle the mobile view
|
When I go to the users edit page
|
||||||
And I go to the users edit page
|
|
||||||
And I put in my password in "close_account_password"
|
And I put in my password in "close_account_password"
|
||||||
And I press "close_account_confirm"
|
And I press "close_account_confirm"
|
||||||
And I confirm the alert
|
And I confirm the alert
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
@javascript
|
@javascript @mobile
|
||||||
Feature: private conversations mobile
|
Feature: private conversations mobile
|
||||||
In order to be talkative
|
In order to be talkative
|
||||||
As a mobile user
|
As a mobile user
|
||||||
|
|
@ -8,7 +8,6 @@ Feature: private conversations mobile
|
||||||
Given a user with username "bob"
|
Given a user with username "bob"
|
||||||
And a user named "Alice Awesome" with email "alice@alice.alice"
|
And a user named "Alice Awesome" with email "alice@alice.alice"
|
||||||
And a user with username "bob" is connected with "alice_awesome"
|
And a user with username "bob" is connected with "alice_awesome"
|
||||||
When I toggle the mobile view
|
|
||||||
And I sign in as "bob@bob.bob" on the mobile website
|
And I sign in as "bob@bob.bob" on the mobile website
|
||||||
|
|
||||||
Scenario: send and delete a mobile message
|
Scenario: send and delete a mobile message
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
@javascript
|
@javascript @mobile
|
||||||
Feature: Naviguate between pages using the header menu and the drawer
|
Feature: Navigate between pages using the header menu and the drawer
|
||||||
As a user
|
As a user
|
||||||
I want to be able naviguate between the pages of the mobile version
|
I want to be able navigate between the pages of the mobile version
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given following users exist:
|
Given following users exist:
|
||||||
|
|
@ -11,25 +11,22 @@ Feature: Naviguate between pages using the header menu and the drawer
|
||||||
|
|
||||||
And I sign in as "alice@alice.alice"
|
And I sign in as "alice@alice.alice"
|
||||||
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
|
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
|
||||||
And I search for "#boss"
|
|
||||||
And I press "Follow #boss"
|
|
||||||
And I toggle the mobile view
|
|
||||||
|
|
||||||
Scenario: naviguate to the stream page
|
Scenario: navigate to the stream page
|
||||||
When I open the drawer
|
When I open the drawer
|
||||||
And I follow "My activity"
|
And I follow "My activity"
|
||||||
And I click on selector "#header_title"
|
And I click on selector "#header_title"
|
||||||
Then I should see "There are no posts yet." within "#main_stream"
|
Then I should see "There are no posts yet." within "#main_stream"
|
||||||
|
|
||||||
Scenario: naviguate to the notification page
|
Scenario: navigate to the notification page
|
||||||
When I click on selector "#notification_badge"
|
When I click on selector "#notification_badge"
|
||||||
Then I should see "Notifications" within "#main"
|
Then I should see "Notifications" within "#main"
|
||||||
|
|
||||||
Scenario: naviguate to the conversation page
|
Scenario: navigate to the conversation page
|
||||||
When I click on selector "#conversations_badge"
|
When I click on selector "#conversations_badge"
|
||||||
Then I should see "Inbox" within "#main"
|
Then I should see "Inbox" within "#main"
|
||||||
|
|
||||||
Scenario: naviguate to the publisher page
|
Scenario: navigate to the publisher page
|
||||||
When I click on selector "#compose_badge"
|
When I click on selector "#compose_badge"
|
||||||
Then I should see "All aspects" within "#new_status_message"
|
Then I should see "All aspects" within "#new_status_message"
|
||||||
|
|
||||||
|
|
@ -43,19 +40,19 @@ Feature: Naviguate between pages using the header menu and the drawer
|
||||||
And I search for "#bob"
|
And I search for "#bob"
|
||||||
Then I should see "#bob" within "#main > h1"
|
Then I should see "#bob" within "#main > h1"
|
||||||
|
|
||||||
Scenario: naviguate to my activity page
|
Scenario: navigate to my activity page
|
||||||
When I open the drawer
|
When I open the drawer
|
||||||
And I follow "My activity"
|
And I follow "My activity"
|
||||||
Then I should see "My activity" within "#main"
|
Then I should see "My activity" within "#main"
|
||||||
|
|
||||||
Scenario: naviguate to my mentions page
|
Scenario: navigate to my mentions page
|
||||||
Given Alice has a post mentioning Bob
|
Given Alice has a post mentioning Bob
|
||||||
And I sign in as "bob@bob.bob"
|
And I sign in as "bob@bob.bob"
|
||||||
When I open the drawer
|
When I open the drawer
|
||||||
And I follow "@Mentions"
|
And I follow "@Mentions"
|
||||||
Then I should see "Bob Jones" within ".stream_element"
|
Then I should see "Bob Jones" within ".stream_element"
|
||||||
|
|
||||||
Scenario: naviguate to my aspects page
|
Scenario: navigate to my aspects page
|
||||||
Given "bob@bob.bob" has a public post with text "bob's text"
|
Given "bob@bob.bob" has a public post with text "bob's text"
|
||||||
When I open the drawer
|
When I open the drawer
|
||||||
And I follow "My aspects"
|
And I follow "My aspects"
|
||||||
|
|
@ -63,25 +60,29 @@ Feature: Naviguate between pages using the header menu and the drawer
|
||||||
And I follow "Besties"
|
And I follow "Besties"
|
||||||
Then I should see "bob's text" within "#main_stream"
|
Then I should see "bob's text" within "#main_stream"
|
||||||
|
|
||||||
Scenario: naviguate to the followed tags page
|
Scenario: navigate to the followed tags page
|
||||||
Given "bob@bob.bob" has a public post with text "bob is da #boss"
|
Given "bob@bob.bob" has a public post with text "bob is da #boss"
|
||||||
|
And I toggle the mobile view
|
||||||
|
And I search for "#boss"
|
||||||
|
And I press "Follow #boss"
|
||||||
|
And I toggle the mobile view
|
||||||
When I open the drawer
|
When I open the drawer
|
||||||
And I follow "#Followed tags"
|
And I follow "#Followed tags"
|
||||||
Then I should see "#boss" within "#followed_tags + li > ul"
|
Then I should see "#boss" within "#followed_tags + li > ul"
|
||||||
And I follow "#boss"
|
And I follow "#boss"
|
||||||
Then I should see "bob is da #boss" within "#main_stream"
|
Then I should see "bob is da #boss" within "#main_stream"
|
||||||
|
|
||||||
Scenario: naviguate to my profile page
|
Scenario: navigate to my profile page
|
||||||
When I open the drawer
|
When I open the drawer
|
||||||
And I follow "Profile"
|
And I follow "Profile"
|
||||||
Then I should see "Alice" within "#author_info"
|
Then I should see "Alice" within "#author_info"
|
||||||
|
|
||||||
Scenario: naviguate to my mentions page
|
Scenario: navigate to my mentions page
|
||||||
When I open the drawer
|
When I open the drawer
|
||||||
And I follow "Contacts"
|
And I follow "Contacts"
|
||||||
Then I should see "Contacts" within "#main"
|
Then I should see "Contacts" within "#main"
|
||||||
|
|
||||||
Scenario: naviguate to my mentions page
|
Scenario: navigate to my mentions page
|
||||||
When I open the drawer
|
When I open the drawer
|
||||||
And I follow "Settings"
|
And I follow "Settings"
|
||||||
Then I should see "Settings" within "#main"
|
Then I should see "Settings" within "#main"
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
@javascript
|
@javascript @mobile
|
||||||
Feature: editing the profile in the mobile view
|
Feature: editing the profile in the mobile view
|
||||||
Scenario: editing profile fields
|
Scenario: editing profile fields
|
||||||
Given I am signed in
|
Given I am signed in
|
||||||
And I toggle the mobile view
|
|
||||||
And I go to the edit profile page
|
And I go to the edit profile page
|
||||||
|
|
||||||
When I fill in the following:
|
When I fill in the following:
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
@javascript
|
@javascript @mobile
|
||||||
Feature: editing the getting started in the mobile view
|
Feature: editing the getting started in the mobile view
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given I toggle the mobile view
|
Given I am on the login page
|
||||||
And I am on the login page
|
|
||||||
When I follow "Sign up"
|
When I follow "Sign up"
|
||||||
And I fill in the new user form
|
And I fill in the new user form
|
||||||
And I submit the form
|
And I submit the form
|
||||||
|
|
|
||||||
12
features/mobile/home.feature
Normal file
12
features/mobile/home.feature
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
@javascript @mobile
|
||||||
|
Feature: Visit the landing page of the pod
|
||||||
|
In order to find out more about the pod
|
||||||
|
As a user
|
||||||
|
I want to see the landing page
|
||||||
|
|
||||||
|
Scenario: Visit the home page
|
||||||
|
When I am on the root page
|
||||||
|
Then I should see "LOG IN"
|
||||||
|
When I toggle the mobile view
|
||||||
|
And I go to the root page
|
||||||
|
Then I should see "Welcome, friend"
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
@javascript
|
@javascript @mobile
|
||||||
Feature: Invitations
|
Feature: Invitations
|
||||||
|
|
||||||
Background:
|
|
||||||
Given I toggle the mobile view
|
|
||||||
|
|
||||||
Scenario: Accepting an invitation
|
Scenario: Accepting an invitation
|
||||||
When I visit alice's invitation code url
|
When I visit alice's invitation code url
|
||||||
When I fill in the new user form
|
When I fill in the new user form
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
@javascript
|
@javascript @mobile
|
||||||
Feature: Browsing Diaspora as a logged out user mobile
|
Feature: Browsing Diaspora as a logged out user mobile
|
||||||
In order to view public diaspora content
|
In order to view public diaspora content
|
||||||
as a random internet user
|
as a random internet user
|
||||||
|
|
@ -8,12 +8,14 @@ Feature: Browsing Diaspora as a logged out user mobile
|
||||||
Given a user named "Bob Jones" with email "bob@bob.bob"
|
Given a user named "Bob Jones" with email "bob@bob.bob"
|
||||||
And "bob@bob.bob" has a public post with text "public stuff"
|
And "bob@bob.bob" has a public post with text "public stuff"
|
||||||
And I sign in as "bob@bob.bob"
|
And I sign in as "bob@bob.bob"
|
||||||
And I comment "this also" on "public stuff"
|
And I click on selector "a.image_link.comment_action.inactive"
|
||||||
|
And I fill in the following:
|
||||||
|
| text | this also |
|
||||||
|
And I press "Comment"
|
||||||
And I log out
|
And I log out
|
||||||
|
|
||||||
Scenario: Visiting a profile page
|
Scenario: Visiting a profile page
|
||||||
When I toggle the mobile view
|
When I am on "bob@bob.bob"'s page
|
||||||
And I am on "bob@bob.bob"'s page
|
|
||||||
Then I should see "public stuff" within ".ltr"
|
Then I should see "public stuff" within ".ltr"
|
||||||
And I click on selector "a.show_comments"
|
And I click on selector "a.show_comments"
|
||||||
And I should see "this also" within ".comment"
|
And I should see "this also" within ".comment"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
@javascript
|
@javascript @mobile
|
||||||
Feature: viewing photos on the mobile main page
|
Feature: viewing photos on the mobile main page
|
||||||
In order to navigate Diaspora*
|
In order to navigate Diaspora*
|
||||||
As a mobile user
|
As a mobile user
|
||||||
|
|
@ -6,9 +6,7 @@ Feature: viewing photos on the mobile main page
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given a user with username "bob"
|
Given a user with username "bob"
|
||||||
|
When I sign in as "bob@bob.bob" on the mobile website
|
||||||
When I toggle the mobile view
|
|
||||||
And I sign in as "bob@bob.bob" on the mobile website
|
|
||||||
And I click on selector "#compose_badge"
|
And I click on selector "#compose_badge"
|
||||||
|
|
||||||
Scenario: view full size image
|
Scenario: view full size image
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
@javascript
|
@javascript @mobile
|
||||||
Feature: adding and removing people from aspects
|
Feature: adding and removing people from aspects
|
||||||
In order to add people to my contacts
|
In order to add people to my contacts
|
||||||
As a mobile user
|
As a mobile user
|
||||||
|
|
@ -9,7 +9,6 @@ Feature: adding and removing people from aspects
|
||||||
| username |
|
| username |
|
||||||
| bob |
|
| bob |
|
||||||
| alice |
|
| alice |
|
||||||
And I toggle the mobile view
|
|
||||||
And I sign in as "bob@bob.bob" on the mobile website
|
And I sign in as "bob@bob.bob" on the mobile website
|
||||||
|
|
||||||
Scenario: verify different states of the cover button
|
Scenario: verify different states of the cover button
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
@javascript
|
@javascript @mobile
|
||||||
Feature: posting from the mobile main page
|
Feature: posting from the mobile main page
|
||||||
In order to navigate Diaspora*
|
In order to navigate Diaspora*
|
||||||
As a mobile user
|
As a mobile user
|
||||||
|
|
@ -9,7 +9,6 @@ Feature: posting from the mobile main page
|
||||||
| username |
|
| username |
|
||||||
| bob |
|
| bob |
|
||||||
| alice |
|
| alice |
|
||||||
And I toggle the mobile view
|
|
||||||
And I am on the home page
|
And I am on the home page
|
||||||
And I sign in as "bob@bob.bob" on the mobile website
|
And I sign in as "bob@bob.bob" on the mobile website
|
||||||
And a user with username "bob" is connected with "alice"
|
And a user with username "bob" is connected with "alice"
|
||||||
|
|
@ -24,7 +23,7 @@ Feature: posting from the mobile main page
|
||||||
And I append "I am eating yogurt" to the mobile publisher
|
And I append "I am eating yogurt" to the mobile publisher
|
||||||
And I select "Unicorns" from "aspect_ids_"
|
And I select "Unicorns" from "aspect_ids_"
|
||||||
And I press "Share"
|
And I press "Share"
|
||||||
When I visit the mobile stream page
|
When I go to the stream page
|
||||||
Then I should see "I am eating yogurt"
|
Then I should see "I am eating yogurt"
|
||||||
When I click on selector "a.remove"
|
When I click on selector "a.remove"
|
||||||
And I confirm the alert
|
And I confirm the alert
|
||||||
|
|
@ -36,11 +35,11 @@ Feature: posting from the mobile main page
|
||||||
Then I should see an uploaded image within the photo drop zone
|
Then I should see an uploaded image within the photo drop zone
|
||||||
And I should see "button.png completed"
|
And I should see "button.png completed"
|
||||||
When I press "Share"
|
When I press "Share"
|
||||||
When I visit the mobile stream page
|
When I go to the stream page
|
||||||
Then I should see a "img" within ".stream_element div.photo_attachments"
|
Then I should see a "img" within ".stream_element div.photo_attachments"
|
||||||
When I log out
|
When I log out
|
||||||
And I sign in as "alice@alice.alice" on the mobile website
|
And I sign in as "alice@alice.alice" on the mobile website
|
||||||
When I visit the mobile stream page
|
When I go to the stream page
|
||||||
Then I should see a "img" within ".stream_element div.photo_attachments"
|
Then I should see a "img" within ".stream_element div.photo_attachments"
|
||||||
|
|
||||||
Scenario: back out of posting a photo-only post
|
Scenario: back out of posting a photo-only post
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
@javascript
|
@javascript @mobile
|
||||||
Feature: reactions mobile post
|
Feature: reactions mobile post
|
||||||
In order to navigate Diaspora*
|
In order to navigate Diaspora*
|
||||||
As a mobile user
|
As a mobile user
|
||||||
|
|
@ -11,7 +11,6 @@ Feature: reactions mobile post
|
||||||
| Alice Smith | alice@alice.alice |
|
| Alice Smith | alice@alice.alice |
|
||||||
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
|
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
|
||||||
When "alice@alice.alice" has posted a status message with a photo
|
When "alice@alice.alice" has posted a status message with a photo
|
||||||
And I toggle the mobile view
|
|
||||||
And I sign in as "bob@bob.bob" on the mobile website
|
And I sign in as "bob@bob.bob" on the mobile website
|
||||||
|
|
||||||
Scenario: like on a mobile post
|
Scenario: like on a mobile post
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
@javascript
|
@javascript @mobile
|
||||||
Feature: resharing from the mobile
|
Feature: resharing from the mobile
|
||||||
In order to make Diaspora more viral
|
In order to make Diaspora more viral
|
||||||
As a mobile user
|
As a mobile user
|
||||||
|
|
@ -16,7 +16,6 @@ Feature: resharing from the mobile
|
||||||
And I sign in as "alice@alice.alice"
|
And I sign in as "alice@alice.alice"
|
||||||
|
|
||||||
Scenario: Resharing a post from a single post page
|
Scenario: Resharing a post from a single post page
|
||||||
When I toggle the mobile view
|
|
||||||
And I click on selector "a.image_link.reshare_action.inactive"
|
And I click on selector "a.image_link.reshare_action.inactive"
|
||||||
And I confirm the alert
|
And I confirm the alert
|
||||||
Then I should see a "a.image_link.reshare_action.active"
|
Then I should see a "a.image_link.reshare_action.active"
|
||||||
|
|
@ -26,7 +25,6 @@ Feature: resharing from the mobile
|
||||||
Scenario: Resharing a post from a single post page that is reshared
|
Scenario: Resharing a post from a single post page that is reshared
|
||||||
Given the post with text "reshare this!" is reshared by "eve@eve.eve"
|
Given the post with text "reshare this!" is reshared by "eve@eve.eve"
|
||||||
And a user with email "alice@alice.alice" is connected with "eve@eve.eve"
|
And a user with email "alice@alice.alice" is connected with "eve@eve.eve"
|
||||||
When I toggle the mobile view
|
|
||||||
And I click on the first selector "a.image_link.reshare_action.inactive"
|
And I click on the first selector "a.image_link.reshare_action.inactive"
|
||||||
And I confirm the alert
|
And I confirm the alert
|
||||||
Then I should see a "a.image_link.reshare_action.active"
|
Then I should see a "a.image_link.reshare_action.active"
|
||||||
|
|
@ -36,11 +34,12 @@ Feature: resharing from the mobile
|
||||||
Scenario: Delete original reshared post
|
Scenario: Delete original reshared post
|
||||||
Given "alice@alice.alice" has a public post with text "Don't reshare this!"
|
Given "alice@alice.alice" has a public post with text "Don't reshare this!"
|
||||||
And the post with text "Don't reshare this!" is reshared by "bob@bob.bob"
|
And the post with text "Don't reshare this!" is reshared by "bob@bob.bob"
|
||||||
|
When I toggle the mobile view
|
||||||
And I am on "alice@alice.alice"'s page
|
And I am on "alice@alice.alice"'s page
|
||||||
When I click to delete the first post
|
And I click to delete the first post
|
||||||
And I log out
|
And I log out
|
||||||
And I sign in as "bob@bob.bob"
|
|
||||||
And I toggle the mobile view
|
And I toggle the mobile view
|
||||||
|
And I sign in as "bob@bob.bob"
|
||||||
Then I should see "Original post deleted by author" within ".reshare"
|
Then I should see "Original post deleted by author" within ".reshare"
|
||||||
And I log out
|
And I log out
|
||||||
And I sign in as "eve@eve.eve" on the mobile website
|
And I sign in as "eve@eve.eve" on the mobile website
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
@javascript
|
@javascript @mobile
|
||||||
Feature: New user registration
|
Feature: New user registration
|
||||||
In order to use Diaspora*
|
In order to use Diaspora*
|
||||||
As a mobile user
|
As a mobile user
|
||||||
I want to register an account
|
I want to register an account
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given I toggle the mobile view
|
Given I am on the login page
|
||||||
And I am on the login page
|
|
||||||
And I follow "Sign up"
|
And I follow "Sign up"
|
||||||
|
|
||||||
Scenario: user signs up and goes to getting started
|
Scenario: user signs up and goes to getting started
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
@javascript
|
@javascript @mobile
|
||||||
Feature: Interacting with tags
|
Feature: Interacting with tags
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given a user with username "alice"
|
Given a user with username "alice"
|
||||||
And "alice@alice.alice" has a public post with text "Hello! i am #newhere"
|
And "alice@alice.alice" has a public post with text "Hello! i am #newhere"
|
||||||
When I sign in as "alice@alice.alice"
|
When I sign in as "alice@alice.alice"
|
||||||
And I toggle the mobile view
|
|
||||||
|
|
||||||
Scenario: Searching for a tag
|
Scenario: Searching for a tag
|
||||||
When I visit the mobile search page
|
When I visit the mobile search page
|
||||||
|
|
|
||||||
|
|
@ -88,10 +88,10 @@ And /^I hover over the "([^"]+)"$/ do |element|
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I prepare the deletion of the first post$/ do
|
When /^I prepare the deletion of the first post$/ do
|
||||||
within(find('.stream .stream_element')) do
|
within(find(".stream .stream_element", match: :first)) do
|
||||||
ctrl = find('.control-icons')
|
ctrl = find(".control-icons")
|
||||||
ctrl.hover
|
ctrl.hover
|
||||||
ctrl.find('.remove_post').click
|
ctrl.find(".remove_post").click
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,30 +2,10 @@ When /^I toggle the mobile view$/ do
|
||||||
visit('/mobile/toggle')
|
visit('/mobile/toggle')
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I visit the mobile home page$/ do
|
|
||||||
visit('/users/sign_in.mobile')
|
|
||||||
end
|
|
||||||
|
|
||||||
When /^I visit the mobile registration page$/ do
|
|
||||||
visit('/users/sign_up.mobile')
|
|
||||||
end
|
|
||||||
|
|
||||||
When /^I visit the mobile getting started page$/ do
|
|
||||||
visit('/getting_started.mobile')
|
|
||||||
end
|
|
||||||
|
|
||||||
Given /^I visit the mobile publisher page$/ do
|
Given /^I visit the mobile publisher page$/ do
|
||||||
visit('/status_messages/new.mobile')
|
visit('/status_messages/new.mobile')
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I visit the mobile stream page$/ do
|
|
||||||
visit('/stream.mobile')
|
|
||||||
end
|
|
||||||
|
|
||||||
When /^I visit the mobile aspects page$/ do
|
|
||||||
visit('/aspects.mobile')
|
|
||||||
end
|
|
||||||
|
|
||||||
When /^I visit the mobile search page$/ do
|
When /^I visit the mobile search page$/ do
|
||||||
visit('/people.mobile')
|
visit('/people.mobile')
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
require 'rubygems'
|
require "rubygems"
|
||||||
|
|
||||||
ENV["RAILS_ENV"] ||= "test"
|
ENV["RAILS_ENV"] ||= "test"
|
||||||
|
|
||||||
# Have all rests run with english browser locale
|
# Have all rests run with english browser locale
|
||||||
ENV['LANG'] = 'C'
|
ENV["LANG"] = "C"
|
||||||
|
|
||||||
require 'cucumber/rails'
|
require "cucumber/rails"
|
||||||
|
|
||||||
require 'capybara/rails'
|
require "capybara/rails"
|
||||||
require 'capybara/cucumber'
|
require "capybara/cucumber"
|
||||||
require 'capybara/session'
|
require "capybara/session"
|
||||||
#require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript
|
require "selenium/webdriver"
|
||||||
|
|
||||||
# Ensure we know the appservers port
|
# Ensure we know the appservers port
|
||||||
Capybara.server_port = AppConfig.pod_uri.port
|
Capybara.server_port = AppConfig.pod_uri.port
|
||||||
|
|
@ -18,12 +18,20 @@ Rails.application.routes.default_url_options[:host] = AppConfig.pod_uri.host
|
||||||
Rails.application.routes.default_url_options[:port] = AppConfig.pod_uri.port
|
Rails.application.routes.default_url_options[:port] = AppConfig.pod_uri.port
|
||||||
|
|
||||||
# Use a version of Firefox defined by environment variable, if set
|
# Use a version of Firefox defined by environment variable, if set
|
||||||
|
Selenium::WebDriver::Firefox::Binary.path = ENV["FIREFOX_BINARY_PATH"] || Selenium::WebDriver::Firefox::Binary.path
|
||||||
|
|
||||||
Capybara.register_driver :selenium do |app|
|
Capybara.register_driver :selenium do |app|
|
||||||
require 'selenium/webdriver'
|
Capybara::Selenium::Driver.new(app, browser: :firefox)
|
||||||
Selenium::WebDriver::Firefox::Binary.path = ENV['FIREFOX_BINARY_PATH'] || Selenium::WebDriver::Firefox::Binary.path
|
|
||||||
Capybara::Selenium::Driver.new(app, :browser => :firefox)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Capybara.register_driver :mobile do |app|
|
||||||
|
profile = Selenium::WebDriver::Firefox::Profile.new
|
||||||
|
profile["general.useragent.override"] = "Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0"
|
||||||
|
Capybara::Selenium::Driver.new(app, profile: profile)
|
||||||
|
end
|
||||||
|
|
||||||
|
Capybara.default_driver = :selenium
|
||||||
|
|
||||||
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
|
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
|
||||||
# order to ease the transition to Capybara we set the default here. If you'd
|
# order to ease the transition to Capybara we set the default here. If you'd
|
||||||
# prefer to use XPath just remove this line and adjust any selectors in your
|
# prefer to use XPath just remove this line and adjust any selectors in your
|
||||||
|
|
|
||||||
|
|
@ -2,36 +2,40 @@
|
||||||
# licensed under the Affero General Public License version 3 or later. See
|
# licensed under the Affero General Public License version 3 or later. See
|
||||||
# the COPYRIGHT file.
|
# the COPYRIGHT file.
|
||||||
|
|
||||||
require 'spec_helper'
|
require "spec_helper"
|
||||||
|
|
||||||
describe HomeController, :type => :controller do
|
describe HomeController, type: :controller do
|
||||||
describe '#show' do
|
describe "#show" do
|
||||||
it 'does not redirect' do
|
it "does not redirect for :html" do
|
||||||
sign_out :user
|
|
||||||
get :show
|
get :show
|
||||||
expect(response).not_to be_redirect
|
expect(response).not_to be_redirect
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'redirection' do
|
it "redirects for :mobile" do
|
||||||
|
get :show, format: :mobile
|
||||||
|
expect(response).to redirect_to(user_session_path)
|
||||||
|
end
|
||||||
|
|
||||||
|
context "redirection" do
|
||||||
before do
|
before do
|
||||||
sign_in alice
|
sign_in alice
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'points to the stream if a user has contacts' do
|
it "points to the stream if a user has contacts" do
|
||||||
get :show, :home => true
|
get :show, home: true
|
||||||
expect(response).to redirect_to(stream_path)
|
expect(response).to redirect_to(stream_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#toggle_mobile' do
|
describe "#toggle_mobile" do
|
||||||
it 'changes :mobile to :html' do
|
it "changes :mobile to :html" do
|
||||||
session[:mobile_view] = true
|
session[:mobile_view] = true
|
||||||
get :toggle_mobile
|
get :toggle_mobile
|
||||||
expect(session[:mobile_view]).to be false
|
expect(session[:mobile_view]).to be false
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'changes :html to :mobile' do
|
it "changes :html to :mobile" do
|
||||||
session[:mobile_view] = nil
|
session[:mobile_view] = nil
|
||||||
get :toggle_mobile
|
get :toggle_mobile
|
||||||
expect(session[:mobile_view]).to be true
|
expect(session[:mobile_view]).to be true
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
# licensed under the Affero General Public License version 3 or later. See
|
# licensed under the Affero General Public License version 3 or later. See
|
||||||
# the COPYRIGHT file.
|
# the COPYRIGHT file.
|
||||||
|
|
||||||
require 'spec_helper'
|
require "spec_helper"
|
||||||
|
|
||||||
describe SessionsController, :type => :controller do
|
describe SessionsController, type: :controller do
|
||||||
include Devise::TestHelpers
|
include Devise::TestHelpers
|
||||||
|
|
||||||
let(:mock_access_token) { Object.new }
|
let(:mock_access_token) { Object.new }
|
||||||
|
|
@ -25,7 +25,7 @@ describe SessionsController, :type => :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "redirects to /stream for a mobile user" do
|
it "redirects to /stream for a mobile user" do
|
||||||
@request.env['HTTP_USER_AGENT'] = 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7'
|
request.headers["X_MOBILE_DEVICE"] = true
|
||||||
post :create, {"user" => {"remember_me" => "0", "username" => @user.username, "password" => "evankorth"}}
|
post :create, {"user" => {"remember_me" => "0", "username" => @user.username, "password" => "evankorth"}}
|
||||||
expect(response).to be_redirect
|
expect(response).to be_redirect
|
||||||
expect(response.location).to match /^#{stream_url}\??$/
|
expect(response.location).to match /^#{stream_url}\??$/
|
||||||
|
|
@ -42,7 +42,7 @@ describe SessionsController, :type => :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "redirects to / for a mobile user" do
|
it "redirects to / for a mobile user" do
|
||||||
@request.env['HTTP_USER_AGENT'] = 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7'
|
request.headers["X_MOBILE_DEVICE"] = true
|
||||||
delete :destroy
|
delete :destroy
|
||||||
expect(response).to redirect_to root_path
|
expect(response).to redirect_to root_path
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue