Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 215 lines (205 sloc) 16.713 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 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
Feature: Classified Authorization
In order to ensure the appropriate classified authorizations are maintained
As a user
I want to verify the user state authorizations

Three allow types, all, friends and friends of friends. All allows any user to grab
the items, except for a loaner item, which requires the user to be a member of the
community. User types are owner (Owner of the classified in question), generic (a non
associated member of the community), anonymous (a non logged in user), friend (a friend
of the owner of the classified), friend_of_friend (a friend of a friend (2 levels deep)
of the owner of the classified.

Scenario Outline: view classified authorization
Given a user exists
And a <user_status> classifed user exists
And a classified exists with aasm_state: "<aasm_state>", listing_type: "<listing_type>", allow: "<allow>", user: the user
Then the user is_allowed? should return "<is_allowed>"
Then the user should be able to view the page: <is_allowed>

Scenarios: STATE:: available
| aasm_state | user_status | listing_type | allow | is_allowed |
| available | owner | sale | all | true |
| available | owner | sale | friends | true |
| available | owner | sale | friends_of_friends | true |
| available | generic | sale | all | true |
| available | generic | sale | friends | false |
| available | generic | sale | friends_of_friends | false |
| available | anonymous | sale | all | true |
| available | anonymous | sale | friends | false |
| available | anonymous | sale | friends_of_friends | false |
| available | friend | sale | all | true |
| available | friend | sale | friends | true |
| available | friend | sale | friends_of_friends | true |
| available | friend_of_friend | sale | all | true |
| available | friend_of_friend | sale | friends | false |
| available | friend_of_friend | sale | friends_of_friends | true |
| available | owner | loan | all | true |
| available | owner | loan | friends | true |
| available | owner | loan | friends_of_friends | true |
| available | generic | loan | all | true |
| available | generic | loan | friends | false |
| available | generic | loan | friends_of_friends | false |
| available | anonymous | loan | all | false |
| available | anonymous | loan | friends | false |
| available | anonymous | loan | friends_of_friends | false |
| available | friend | loan | all | true |
| available | friend | loan | friends | true |
| available | friend | loan | friends_of_friends | true |
| available | friend_of_friend | loan | all | true |
| available | friend_of_friend | loan | friends | false |
| available | friend_of_friend | loan | friends_of_friends | true |
| available | owner | free | all | true |
| available | owner | free | friends | true |
| available | owner | free | friends_of_friends | true |
| available | generic | free | all | true |
| available | generic | free | friends | false |
| available | generic | free | friends_of_friends | false |
| available | anonymous | free | all | true |
| available | anonymous | free | friends | false |
| available | anonymous | free | friends_of_friends | false |
| available | friend | free | all | true |
| available | friend | free | friends | true |
| available | friend | free | friends_of_friends | true |
| available | friend_of_friend | free | all | true |
| available | friend_of_friend | free | friends | false |
| available | friend_of_friend | free | friends_of_friends | true |

Scenarios: STATE:: unpublished
| aasm_state | user_status | listing_type | allow | is_allowed |
| unpublished | owner | sale | all | true |
| unpublished | generic | sale | all | false |
| unpublished | anonymous | sale | all | false |
| unpublished | friend | sale | all | false |
| unpublished | friend_of_friend | sale | all | false |

Scenarios: STATE:: closed
| aasm_state | user_status | listing_type | allow | is_allowed |
| closed | owner | sale | all | true |
| closed | owner | sale | friends | true |
| closed | owner | sale | friends_of_friends | true |
| closed | generic | sale | all | true |
| closed | generic | sale | friends | false |
| closed | generic | sale | friends_of_friends | false |
| closed | anonymous | sale | all | true |
| closed | anonymous | sale | friends | false |
| closed | anonymous | sale | friends_of_friends | false |
| closed | friend | sale | all | true |
| closed | friend | sale | friends | true |
| closed | friend | sale | friends_of_friends | true |
| closed | friend_of_friend | sale | all | true |
| closed | friend_of_friend | sale | friends | false |
| closed | friend_of_friend | sale | friends_of_friends | true |
| closed | owner | loan | all | true |
| closed | owner | loan | friends | true |
| closed | owner | loan | friends_of_friends | true |
| closed | generic | loan | all | true |
| closed | generic | loan | friends | false |
| closed | generic | loan | friends_of_friends | false |
| closed | anonymous | loan | all | false |
| closed | anonymous | loan | friends | false |
| closed | anonymous | loan | friends_of_friends | false |
| closed | friend | loan | all | true |
| closed | friend | loan | friends | true |
| closed | friend | loan | friends_of_friends | true |
| closed | friend_of_friend | loan | all | true |
| closed | friend_of_friend | loan | friends | false |
| closed | friend_of_friend | loan | friends_of_friends | true |
| closed | owner | free | all | true |
| closed | owner | free | friends | true |
| closed | owner | free | friends_of_friends | true |
| closed | generic | free | all | true |
| closed | generic | free | friends | false |
| closed | generic | free | friends_of_friends | false |
| closed | anonymous | free | all | true |
| closed | anonymous | free | friends | false |
| closed | anonymous | free | friends_of_friends | false |
| closed | friend | free | all | true |
| closed | friend | free | friends | true |
| closed | friend | free | friends_of_friends | true |
| closed | friend_of_friend | free | all | true |
| closed | friend_of_friend | free | friends | false |
| closed | friend_of_friend | free | friends_of_friends | true |

Scenarios: STATE:: expired
| aasm_state | user_status | listing_type | allow | is_allowed |
| expired | owner | sale | all | true |
| expired | owner | sale | friends | true |
| expired | owner | sale | friends_of_friends | true |
| expired | generic | sale | all | true |
| expired | generic | sale | friends | false |
| expired | generic | sale | friends_of_friends | false |
| expired | anonymous | sale | all | true |
| expired | anonymous | sale | friends | false |
| expired | anonymous | sale | friends_of_friends | false |
| expired | friend | sale | all | true |
| expired | friend | sale | friends | true |
| expired | friend | sale | friends_of_friends | true |
| expired | friend_of_friend | sale | all | true |
| expired | friend_of_friend | sale | friends | false |
| expired | friend_of_friend | sale | friends_of_friends | true |
| expired | owner | loan | all | true |
| expired | owner | loan | friends | true |
| expired | owner | loan | friends_of_friends | true |
| expired | generic | loan | all | true |
| expired | generic | loan | friends | false |
| expired | generic | loan | friends_of_friends | false |
| expired | anonymous | loan | all | false |
| expired | anonymous | loan | friends | false |
| expired | anonymous | loan | friends_of_friends | false |
| expired | friend | loan | all | true |
| expired | friend | loan | friends | true |
| expired | friend | loan | friends_of_friends | true |
| expired | friend_of_friend | loan | all | true |
| expired | friend_of_friend | loan | friends | false |
| expired | friend_of_friend | loan | friends_of_friends | true |
| expired | owner | free | all | true |
| expired | owner | free | friends | true |
| expired | owner | free | friends_of_friends | true |
| expired | generic | free | all | true |
| expired | generic | free | friends | false |
| expired | generic | free | friends_of_friends | false |
| expired | anonymous | free | all | true |
| expired | anonymous | free | friends | false |
| expired | anonymous | free | friends_of_friends | false |
| expired | friend | free | all | true |
| expired | friend | free | friends | true |
| expired | friend | free | friends_of_friends | true |
| expired | friend_of_friend | free | all | true |
| expired | friend_of_friend | free | friends | false |
| expired | friend_of_friend | free | friends_of_friends | true |

Scenarios: STATE:: sold
| aasm_state | user_status | listing_type | allow | is_allowed |
| sold | owner | sale | all | true |
| sold | owner | sale | friends | true |
| sold | owner | sale | friends_of_friends | true |
| sold | generic | sale | all | true |
| sold | generic | sale | friends | false |
| sold | generic | sale | friends_of_friends | false |
| sold | anonymous | sale | all | true |
| sold | anonymous | sale | friends | false |
| sold | anonymous | sale | friends_of_friends | false |
| sold | friend | sale | all | true |
| sold | friend | sale | friends | true |
| sold | friend | sale | friends_of_friends | true |
| sold | friend_of_friend | sale | all | true |
| sold | friend_of_friend | sale | friends | false |
| sold | friend_of_friend | sale | friends_of_friends | true |

Scenarios: STATE:: hidden
| aasm_state | user_status | listing_type | allow | is_allowed |
| hidden | owner | sale | all | true |
| hidden | generic | sale | all | false |
| hidden | anonymous | sale | all | false |
| hidden | friend | sale | all | false |
| hidden | friend_of_friend | sale | all | false |

Scenarios: STATE:: loaned_out
| aasm_state | user_status | listing_type | allow | is_allowed |
| available | owner | loan | all | true |
| available | owner | loan | friends | true |
| available | owner | loan | friends_of_friends | true |
| available | generic | loan | all | true |
| available | generic | loan | friends | false |
| available | generic | loan | friends_of_friends | false |
| available | anonymous | loan | all | false |
| available | anonymous | loan | friends | false |
| available | anonymous | loan | friends_of_friends | false |
| available | friend | loan | all | true |
| available | friend | loan | friends | true |
| available | friend | loan | friends_of_friends | true |
| available | friend_of_friend | loan | all | true |
| available | friend_of_friend | loan | friends | false |
| available | friend_of_friend | loan | friends_of_friends | true |
Something went wrong with that request. Please try again.