Skip to content

Commit

Permalink
Fixing the broken test in master
Browse files Browse the repository at this point in the history
  • Loading branch information
cesy committed May 24, 2011
1 parent 906971a commit e9bd09a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/controllers/works_controller.rb
Expand Up @@ -207,6 +207,8 @@ def new
load_pseuds
@series = current_user.series.uniq
@unposted = current_user.unposted_work
@assignments = current_user.offer_assignments.undefaulted.unfulfilled + current_user.pinch_hit_assignments
@claims = current_user.request_claims.unfulfilled
# for clarity, add the collection and recipient
if params[:assignment_id] && (@challenge_assignment = ChallengeAssignment.find(params[:assignment_id])) && @challenge_assignment.offering_user == current_user
@work.challenge_assignments << @challenge_assignment
Expand Down
4 changes: 4 additions & 0 deletions app/models/work.rb
Expand Up @@ -307,6 +307,10 @@ def challenge_claim_ids
def challenge_assignment_ids=(ids)
self.challenge_assignments = ids.map {|id| id.blank? ? nil : ChallengeAssignment.find(id)}.compact.select {|assignment| assignment.offering_user == User.current_user}
end

def challenge_claim_ids=(ids)
self.challenge_claims = ids.map {|id| id.blank? ? nil : ChallengeClaim.find(id)}.compact.select {|claim| claim.claiming_user == User.current_user}
end

# Set a work's collections based on a list of collection names
# Don't delete all existing collections, or else works in closed collections
Expand Down
4 changes: 2 additions & 2 deletions app/views/works/_standard_form.html.erb
Expand Up @@ -91,7 +91,7 @@
<fieldset id="associations">
<legend><%= ts('Associations') %></legend>
<dl>
<% if !(@assignments = current_user.offer_assignments.undefaulted.unfulfilled + current_user.pinch_hit_assignments).empty? || !@work.challenge_assignments.empty? %>
<% if !@assignments.empty? || !@work.challenge_assignments.empty? %>
<!-- if the user has open assignments? -->
<dt class="collection">
<%= f.label "challenge_assignment_ids[]", ts("Does this fulfill a challenge assignment: ") %> <%= link_to_help "add-work-to-assignment" %>
Expand All @@ -101,7 +101,7 @@
"challenge_assignments", "title", "id" %>
</dd>
<% end %>
<% if !(@claims = current_user.request_claims.unfulfilled).empty? || !@work.challenge_claims.empty? %>
<% if !@claims.empty? || !@work.challenge_claims.empty? %>
<!-- if the user has open claims? -->
<dt class="collection">
<%= f.label "challenge_claim_ids[]", ts("Fulfill a Claim: ") %> <%= link_to_help "add-work-to-assignment" %>
Expand Down
9 changes: 8 additions & 1 deletion features/challenge_promptmeme.feature
Expand Up @@ -261,11 +261,18 @@ Feature: Prompt Meme Challenge
Given I have Battle 12 prompt meme fully set up
When I am logged in as "myname2"
When I sign up for Battle 12 with combination B
# 1st prompt SG-1, 2nd prompt SGA
When I am logged in as "myname1"
And I claim a prompt from "Battle 12"
# SGA as it's in reverse order
And I claim a prompt from "Battle 12"
# SG-1
And I view prompts for "Battle 12"
When I fulfill my claim
When I start to fulfill my claim
# this next line shouldn't be needed - there's still a bug somewhere
And I uncheck "Battle 12 (Anonymous) - - Stargate SG-1 - Alternate Universe - High School, Something else weird"
And I press "Preview"
And I press "Post"
When I view the work "Fulfilled Story"
Then I should see "Stargate Atlantis"
And I should not see "Stargate SG-1"
Expand Down

0 comments on commit e9bd09a

Please sign in to comment.