add the publisher back to ones own profile, fix some cukes
This commit is contained in:
parent
a5da2ca48c
commit
300496090b
8 changed files with 36 additions and 19 deletions
|
|
@ -80,6 +80,11 @@ app.pages.Profile = app.views.Base.extend({
|
||||||
collection: this.streamCollection
|
collection: this.streamCollection
|
||||||
});
|
});
|
||||||
app.stream.fetch();
|
app.stream.fetch();
|
||||||
|
|
||||||
|
if( this.model.get('is_own_profile') ) {
|
||||||
|
app.publisher = new app.views.Publisher({collection : app.stream.items});
|
||||||
|
}
|
||||||
|
|
||||||
return new view({model: app.stream});
|
return new view({model: app.stream});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,14 @@
|
||||||
|
|
||||||
.stream_container
|
.stream_container
|
||||||
|
|
||||||
|
-if user_signed_in? && current_page?(person_path(current_user.person))
|
||||||
|
= render 'publisher/publisher', publisher_aspects_for(nil)
|
||||||
|
|
||||||
#main_stream.stream
|
#main_stream.stream
|
||||||
-# JS
|
-# JS
|
||||||
|
|
||||||
#paginate
|
#paginate
|
||||||
|
%span.loader.hidden
|
||||||
|
|
||||||
%a{:id=>"back-to-top", :title=>"#{t('layouts.application.back_to_top')}", :href=>"#"}
|
%a{:id=>"back-to-top", :title=>"#{t('layouts.application.back_to_top')}", :href=>"#"}
|
||||||
⇧
|
⇧
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,7 @@ Feature: Blocking a user from the stream
|
||||||
Then I should not see any posts in my stream
|
Then I should not see any posts in my stream
|
||||||
|
|
||||||
Scenario: Blocking a user from the profile page
|
Scenario: Blocking a user from the profile page
|
||||||
When I am on the home page
|
When I am on "alice@alice.alice"'s page
|
||||||
And I follow "Alice Smith"
|
|
||||||
When I click on the profile block button
|
When I click on the profile block button
|
||||||
And I confirm the alert
|
And I confirm the alert
|
||||||
And I am on the home page
|
|
||||||
Then I should not see any posts in my stream
|
Then I should not see any posts in my stream
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ Feature: preview posts in the stream
|
||||||
|
|
||||||
Scenario: preview a photo with text
|
Scenario: preview a photo with text
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
|
And I attach "spec/fixtures/button.png" to the publisher
|
||||||
When I fill in the following:
|
When I fill in the following:
|
||||||
| status_message_fake_text | Look at this dog |
|
| status_message_fake_text | Look at this dog |
|
||||||
And I press "Preview"
|
And I press "Preview"
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ Feature: posting from the main page
|
||||||
|
|
||||||
Scenario: post a photo with text
|
Scenario: post a photo with text
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
|
And I attach "spec/fixtures/button.png" to the publisher
|
||||||
When I write the status message "Look at this dog"
|
When I write the status message "Look at this dog"
|
||||||
And I submit the publisher
|
And I submit the publisher
|
||||||
And I go to the aspects page
|
And I go to the aspects page
|
||||||
|
|
@ -83,7 +83,7 @@ Feature: posting from the main page
|
||||||
|
|
||||||
Scenario: post a photo without text
|
Scenario: post a photo without text
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
|
And I attach "spec/fixtures/button.png" to the publisher
|
||||||
Then I should see an uploaded image within the photo drop zone
|
Then I should see an uploaded image within the photo drop zone
|
||||||
When I press "Share"
|
When I press "Share"
|
||||||
And I go to the aspects page
|
And I go to the aspects page
|
||||||
|
|
@ -96,10 +96,10 @@ Feature: posting from the main page
|
||||||
Scenario: back out of posting a photo-only post
|
Scenario: back out of posting a photo-only post
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
And I have turned off jQuery effects
|
And I have turned off jQuery effects
|
||||||
When I attach the file "spec/fixtures/bad_urls.txt" to "file" within "#file-upload"
|
And I attach "spec/fixtures/button.png" to the publisher
|
||||||
And I confirm the alert
|
And I confirm the alert
|
||||||
Then I should not see an uploaded image within the photo drop zone
|
Then I should not see an uploaded image within the photo drop zone
|
||||||
When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
|
And I attach "spec/fixtures/button.png" to the publisher
|
||||||
And I click to delete the first uploaded photo
|
And I click to delete the first uploaded photo
|
||||||
Then I should not see an uploaded image within the photo drop zone
|
Then I should not see an uploaded image within the photo drop zone
|
||||||
And I should not be able to submit the publisher
|
And I should not be able to submit the publisher
|
||||||
|
|
@ -108,7 +108,7 @@ Feature: posting from the main page
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
And I have turned off jQuery effects
|
And I have turned off jQuery effects
|
||||||
When I write the status message "I am eating a yogurt"
|
When I write the status message "I am eating a yogurt"
|
||||||
And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
|
And I attach "spec/fixtures/button.png" to the publisher
|
||||||
And I click to delete the first uploaded photo
|
And I click to delete the first uploaded photo
|
||||||
Then I should not see an uploaded image within the photo drop zone
|
Then I should not see an uploaded image within the photo drop zone
|
||||||
And the publisher should be expanded
|
And the publisher should be expanded
|
||||||
|
|
@ -117,8 +117,8 @@ Feature: posting from the main page
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
And I have turned off jQuery effects
|
And I have turned off jQuery effects
|
||||||
When I write the status message "I am eating a yogurt"
|
When I write the status message "I am eating a yogurt"
|
||||||
And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
|
And I attach "spec/fixtures/button.png" to the publisher
|
||||||
And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
|
And I attach "spec/fixtures/button.png" to the publisher
|
||||||
And I click to delete the first uploaded photo
|
And I click to delete the first uploaded photo
|
||||||
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 the publisher should be expanded
|
And the publisher should be expanded
|
||||||
|
|
|
||||||
|
|
@ -34,11 +34,9 @@ Feature: posting from own profile page
|
||||||
|
|
||||||
Scenario: post a photo with text
|
Scenario: post a photo with text
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
|
When I write the status message "who am I?"
|
||||||
When I fill in the following:
|
And I attach "spec/fixtures/button.png" to the publisher
|
||||||
| status_message_fake_text | who am I? |
|
And I submit the publisher
|
||||||
|
|
||||||
And I press "Share"
|
|
||||||
|
|
||||||
When I am on the home page
|
When I am on the home 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"
|
||||||
|
|
@ -47,6 +45,6 @@ Feature: posting from own profile page
|
||||||
Scenario: back out of posting a photo-only post
|
Scenario: back out of posting a photo-only post
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
And I have turned off jQuery effects
|
And I have turned off jQuery effects
|
||||||
When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
|
And I attach "spec/fixtures/button.png" to the publisher
|
||||||
And I click to delete the first uploaded photo
|
And I click to delete the first uploaded photo
|
||||||
Then I should not see an uploaded image within the photo drop zone
|
Then I should not see an uploaded image within the photo drop zone
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ Then /^I should not see an uploaded image within the photo drop zone$/ do
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should not see any posts in my stream$/ do
|
Then /^I should not see any posts in my stream$/ do
|
||||||
all(".stream_element").should be_empty
|
page.assert_selector(".stream_element", count: 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should not be able to submit the publisher$/ do
|
Then /^I should not be able to submit the publisher$/ do
|
||||||
|
|
@ -83,6 +83,10 @@ When /^I append "([^"]*)" to the mobile publisher$/ do |text|
|
||||||
append_to_publisher(text, '#status_message_text')
|
append_to_publisher(text, '#status_message_text')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
When /^I attach "([^"]*)" to the publisher$/ do |path|
|
||||||
|
upload_file_with_publisher(path)
|
||||||
|
end
|
||||||
|
|
||||||
When /^I open the show page of the "([^"]*)" post$/ do |post_text|
|
When /^I open the show page of the "([^"]*)" post$/ do |post_text|
|
||||||
visit post_path_by_content(post_text)
|
visit post_path_by_content(post_text)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,21 @@ module PublishingCukeHelpers
|
||||||
end
|
end
|
||||||
|
|
||||||
def append_to_publisher(txt, input_selector='#status_message_fake_text')
|
def append_to_publisher(txt, input_selector='#status_message_fake_text')
|
||||||
elem = find(input_selector)
|
elem = find(input_selector, visible: false)
|
||||||
elem.native.send_keys(' ' + txt)
|
elem.native.send_keys(' ' + txt)
|
||||||
|
|
||||||
# make sure the other text field got the new contents
|
# make sure the other text field got the new contents
|
||||||
expect(find('#status_message_text', visible: false).value).to include(txt)
|
expect(find('#status_message_text', visible: false).value).to include(txt)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def upload_file_with_publisher(path)
|
||||||
|
page.execute_script(%q{$("input[name='file']").css("opacity", '1');})
|
||||||
|
with_scope("#publisher_textarea_wrapper") do
|
||||||
|
attach_file("file", Rails.root.join(path).to_s)
|
||||||
|
page.assert_selector(".publisher_photo.loading", count: 0)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def make_post(text)
|
def make_post(text)
|
||||||
write_in_publisher(text)
|
write_in_publisher(text)
|
||||||
submit_publisher
|
submit_publisher
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue