Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 198 lines (173 sloc) 8.276 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
@javascript
Feature: posting from the main page
In order to enlighten humanity for the good of society
As a rock star
I want to tell the world I am eating a yogurt

Background:
Given a user with username "bob"
And a user with username "alice"
And I sign in as "bob@bob.bob"
And a user with username "bob" is connected with "alice"
And I have an aspect called "PostingTo"
And I have an aspect called "NotPostingThingsHere"
And I have user with username "alice" in an aspect called "PostingTo"
And I have user with username "alice" in an aspect called "NotPostingThingsHere"
And I am on the home page

Scenario: post a text-only message to all aspects
Given I expand the publisher
When I fill in "status_message_fake_text" with "I am eating a yogurt"
And I press "Share"
And I wait for the ajax to finish

And I go to the aspects page
Then I should see "I am eating a yogurt" within ".stream_element"

Scenario: posting a message appends it to the top of the stream
When I click the publisher and post "sup dog"
And I click the publisher and post "hello there"
Then I should see "hello there" as the first post in my stream

Scenario: post a text-only message to just one aspect
When I select only "PostingTo" aspect
And I expand the publisher
And I fill in "status_message_fake_text" with "I am eating a yogurt"

And I press "Share"
And I wait for the ajax to finish

When I am on the aspects page
And I select only "PostingTo" aspect
Then I should see "I am eating a yogurt"

When I am on the aspects page
And I select only "NotPostingThingsHere" aspect
Then I should not see "I am eating a yogurt"

Scenario: post a photo with text
Given I expand the publisher
When I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload"
And I fill in "status_message_fake_text" with "Look at this dog"
And I press "Share"
And I wait for the ajax to finish
And I go to the aspects page
Then I should see a "img" within ".stream_element div.photo_attachments"
And I should see "Look at this dog" within ".stream_element"
When I log out
And I sign in as "alice@alice.alice"
And I go to "bob@bob.bob"'s page
Then I should see a "img" within ".stream_element div.photo_attachments"
And I should see "Look at this dog" within ".stream_element"

Scenario: post a photo without text
Given I expand the publisher
When I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload"
And I wait for the ajax to finish
Then I should see an uploaded image within the photo drop zone
When I press "Share"
And I wait for the ajax to finish
And I go to the aspects page
Then I should see a "img" within ".stream_element div.photo_attachments"
When I log out
And I sign in as "alice@alice.alice"
And I go to "bob@bob.bob"'s page
Then I should see a "img" within ".stream_element div.photo_attachments"

Scenario: back out of posting a photo-only post
Given I expand the publisher
And I have turned off jQuery effects
When I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload"
And I wait for the ajax to finish
And I click to delete the first uploaded photo
And I wait for the ajax to finish
Then I should not see an uploaded image within the photo drop zone

Scenario: back out of uploading a picture to a post with text
Given I expand the publisher
And I have turned off jQuery effects
When I fill in "status_message_fake_text" with "I am eating a yogurt"
And I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload"
And I wait for the ajax to finish
And I click to delete the first uploaded photo
And I wait for the ajax to finish
Then I should not see an uploaded image within the photo drop zone
And the publisher should be expanded

Scenario: back out of uploading a picture when another has been attached
Given I expand the publisher
And I have turned off jQuery effects
When I fill in "status_message_fake_text" with "I am eating a yogurt"
And I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload"
And I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload"
And I wait for the ajax to finish
And I click to delete the first uploaded photo
And I wait for the ajax to finish
Then I should see an uploaded image within the photo drop zone
And the publisher should be expanded

@wip
Scenario: hide a contact's post
Given I expand the publisher
When I fill in "status_message_fake_text" with "Here is a post for you to hide"
And I press "Share"
And I wait for the ajax to finish

And I log out
And I sign in as "alice@alice.alice"
And I am on "bob@bob.bob"'s page

And I hover over the ".stream_element"
And I preemptively confirm the alert
And I click to delete the first post
And I wait for the ajax to finish
And I go to "bob@bob.bob"'s page
And I wait for the ajax to finish
Then I should not see "Here is a post for you to hide"
When I am on the aspects page
And I wait for the ajax to finish
Then I should not see "Here is a post for you to hide"

Scenario: delete one of my posts
Given I expand the publisher
When I fill in "status_message_fake_text" with "I am eating a yogurt"
And I press "Share"
And I wait for the ajax to finish
And I go to the aspects page
And I hover over the ".stream_element"
And I preemptively confirm the alert
And I click to delete the first post
And I wait for the ajax to finish
And I go to the aspects page
Then I should not see "I am eating a yogurt"

Scenario: change post target aspects with the aspect-dropdown before posting
When I expand the publisher
And I press the aspect dropdown
And I toggle the aspect "PostingTo"
And I append "I am eating a yogurt" to the publisher
And I press "Share"
And I wait for the ajax to finish

And I am on the aspects page
And I select only "PostingTo" aspect
Then I should see "I am eating a yogurt"
When I am on the aspects page
And I select only "NotPostingThingsHere" aspect
Then I should not see "I am eating a yogurt"

Scenario: post 2 in a row using the aspects-dropdown
When I expand the publisher
And I press the aspect dropdown
And I toggle the aspect "PostingTo"
And I append "I am eating a yogurt" to the publisher
And I press "Share"
And I wait for the ajax to finish

And I expand the publisher
And I press the aspect dropdown
And I toggle the aspect "Besties"
And I append "And cornflakes also" to the publisher
And I press "Share"
And I wait for the ajax to finish

And I am on the aspects page
And I select only "PostingTo" aspect
Then I should see "I am eating a yogurt"
Then I should see "And cornflakes also"
When I am on the aspects page
And I select only "Besties" aspect
Then I should not see "I am eating a yogurt"
Then I should see "And cornflakes also"
When I am on the aspects page
And I select only "NotPostingThingsHere" aspect
Then I should not see "I am eating a yogurt"
Then I should not see "And cornflakes also"

# (NOTE) make this a jasmine spec
Scenario: reject deletion one of my posts
When I expand the publisher
And I fill in "status_message_fake_text" with "I am eating a yogurt"
And I press "Share"
And I wait for the ajax to finish

And I hover over the ".stream_element"
And I preemptively reject the alert
And I click to delete the first post
Then I should see "I am eating a yogurt"
Something went wrong with that request. Please try again.