Skip to content

Commit

Permalink
Issue 2331
Browse files Browse the repository at this point in the history
  • Loading branch information
cesy committed May 27, 2011
1 parent 9097411 commit 31f5cdb
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 9 deletions.
8 changes: 6 additions & 2 deletions app/models/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,14 @@ def unrevealed? ; self.collection_preference.unrevealed ; end
def anonymous? ; self.collection_preference.anonymous ; end
def challenge? ; !self.challenge.nil? ; end
def gift_exchange?
self.collection_preference.gift_exchange
if self.challenge_type == "GiftExchange"
return true
end
end
def prompt_meme?
self.collection_preference.prompt_meme
if self.challenge_type == "PromptMeme"
return true
end
end

def not_empty?
Expand Down
2 changes: 1 addition & 1 deletion app/views/collections/_collection_blurb.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</blockquote>

<p class="type">
(<%= collection.closed? ? t('.collections_index.is_closed', :default => "Closed") : t('.collections_index.open', :default => "Open") %>, <%= collection.moderated? ? t('.collections_index.is_moderated', :default => "Moderated") : t('.collections_index.unmoderated', :default => "Unmoderated") %><%= collection.unrevealed? ? t('.collections_index.is_unrevealed', :default => ", Unrevealed") : "" %><%= collection.anonymous? ? t('.collections_index.is_anonymous', :default => ", Anonymous") : "" %><%= collection.challenge ? t('.collections_index.is_challenge', :default => ", Challenge") : "" %>)
(<%= collection.closed? ? ts("Closed") : ts("Open") %>, <%= collection.moderated? ? ts("Moderated") : ts("Unmoderated") %><%= collection.unrevealed? ? ts(", Unrevealed") : "" %><%= collection.anonymous? ? ts(", Anonymous") : "" %><%= collection.gift_exchange? ? ts(", Gift Exchange Challenge") : "" %><%= collection.prompt_meme? ? ts(", Prompt Meme Challenge") : "" %>)
</p>

<!--stats-->
Expand Down
8 changes: 2 additions & 6 deletions features/challenge_giftexchange.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,14 @@ Feature: Gift Exchange Challenge
When I set up the collection "My Gift Exchange"
And I select "Gift Exchange" from "challenge_type"
And I press "Submit"
Then I should see "Collection was successfully created"
And I should see "Setting Up The My Gift Exchange Gift Exchange"
And I should see gift exchange options
Then My Gift Exchange gift exchange should be correctly created

Scenario: Enter settings for a gift exchange
Given I am logged in as "mod1"
And I have set up the gift exchange "My Gift Exchange"
When I fill in gift exchange challenge options
And I press "Submit"
Then I should see "Challenge was successfully created"
When I follow "Profile"
Then I should see "2011" within ".collection.meta"
Then My Gift Exchange gift exchange should be fully created

Scenario: Open signup in a gift exchange
Given I have created the gift exchange "My Gift Exchange"
Expand Down
16 changes: 16 additions & 0 deletions features/step_definitions/challenge_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,22 @@
Then "Battle 12 collection exists"
end

Then /^My Gift Exchange gift exchange should be correctly created$/ do
Then %{I should see "Collection was successfully created"}
Then %{I should see "Setting Up The My Gift Exchange Gift Exchange"}
Then %{I should see "Offer Settings"}
Then %{I should see "Request Settings"}
Then %{I should see "If you plan to use automated matching"}
Then %{I should see "Allow Any"}
end

Then /^My Gift Exchange gift exchange should be fully created$/ do
Then %{I should see "Challenge was successfully created"}
When %{I follow "Profile"}
Then %{I should see "2011" within ".collection.meta"}
Then "My Gift Exchange collection exists"
end

Then /^my claim should be fulfilled$/ do
Then %{I should see "Work was successfully posted"}
And %{I should see "Fandom:"}
Expand Down
8 changes: 8 additions & 0 deletions features/step_definitions/collection_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,12 @@
When "I go to the collections page"
Then %{I should see "Collections in the "}
And %{I should see "Battle 12"}
And %{I should see "(Open, Unmoderated, Unrevealed, Anonymous, Prompt Meme Challenge)"}
end

Then /^My Gift Exchange collection exists$/ do
When "I go to the collections page"
Then %{I should see "Collections in the "}
And %{I should see "My Gift Exchange"}
And %{I should see "(Open, Unmoderated, Gift Exchange Challenge)"}
end

0 comments on commit 31f5cdb

Please sign in to comment.