Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/controllers/related_works_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ def index

# Extra constraints on what we display if someone else is viewing @user's
# related works page:
@translations_of_user = @translations_of_user.merge(Work.revealed.non_anon)
@remixes_of_user = @remixes_of_user.merge(Work.revealed.non_anon)
@translations_by_user = @translations_by_user.merge(Work.revealed.non_anon)
@remixes_by_user = @remixes_by_user.merge(Work.revealed.non_anon)
@translations_of_user = @translations_of_user.merge(Work.revealed.non_anon).where(reciprocal: true)
@remixes_of_user = @remixes_of_user.merge(Work.revealed.non_anon).where(reciprocal: true)
@translations_by_user = @translations_by_user.merge(Work.revealed.non_anon).where(reciprocal: true)
@remixes_by_user = @remixes_by_user.merge(Work.revealed.non_anon).where(reciprocal: true)
end

# GET /related_works/1
Expand Down
20 changes: 19 additions & 1 deletion features/works/work_related.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ Scenario: Creator of original work can see a remix on their related works page
Then I should see "Works inspired by inspiration"
And I should see "Followup by remixer"

Scenario: Random user should not see unapproved related work on original work Creator's related works page

Given I have related works setup
And a related work has been posted
When I am logged in as "remixer"
And I go to inspiration's related works page
Then I should not see "Works inspired by inspiration"
And I should not see "Followup by remixer"

Scenario: Posting a translation emails the creator of the original work and lists the parent work in the proper location on the translation

Given I have related works setup
Expand Down Expand Up @@ -500,7 +509,9 @@ Scenario: When a user is notified that a co-authored work has been inspired by a
And I go to remixer's related works page
Then I should see "Works that inspired remixer"
And I should see "Worldbuilding by inspiration"
When I go to inspiration's related works page
When I approve a related work
And I am logged in as "remixer"
And I go to inspiration's related works page
Then I should see "Works inspired by inspiration"
And I should see "Followup by Anonymous [remixer]"
When I am logged in as "inspiration"
Expand All @@ -516,6 +527,7 @@ Scenario: When a user is notified that a co-authored work has been inspired by a
Given a hidden collection "Hidden"
And I have related works setup
And I post a related work as remixer
And I approve a related work
When I am logged in as "remixer"
And I edit the work "Followup" to be in the collection "Hidden"
And I go to remixer's related works page
Expand All @@ -538,6 +550,7 @@ Scenario: When a user is notified that a co-authored work has been inspired by a
Given an anonymous collection "Anonymous"
And I have related works setup
And I post a related work as remixer
And I approve a related work
When I am logged in as "inspiration"
And I edit the work "Worldbuilding" to be in the collection "Anonymous"
And I go to remixer's related works page
Expand All @@ -559,6 +572,7 @@ Scenario: When a user is notified that a co-authored work has been inspired by a
Given a hidden collection "Hidden"
And I have related works setup
And I post a related work as remixer
And I approve a related work
When I am logged in as "inspiration"
And I edit the work "Worldbuilding" to be in the collection "Hidden"
And I go to remixer's related works page
Expand All @@ -581,6 +595,7 @@ Scenario: When a user is notified that a co-authored work has been inspired by a
Given an anonymous collection "Anonymous"
And I have related works setup
And I post a translation as translator
And I approve a related work
When I am logged in as "translator"
And I edit the work "Worldbuilding Translated" to be in the collection "Anonymous"
And I go to translator's related works page
Expand All @@ -606,6 +621,7 @@ Scenario: When a user is notified that a co-authored work has been inspired by a
Given a hidden collection "Hidden"
And I have related works setup
And I post a translation as translator
And I approve a related work
When I am logged in as "translator"
And I edit the work "Worldbuilding Translated" to be in the collection "Hidden"
And I go to translator's related works page
Expand All @@ -629,6 +645,7 @@ Scenario: When a user is notified that a co-authored work has been inspired by a
Given an anonymous collection "Anonymous"
And I have related works setup
And I post a translation as translator
And I approve a related work
When I am logged in as "inspiration"
And I edit the work "Worldbuilding" to be in the collection "Anonymous"
And I go to translator's related works page
Expand All @@ -654,6 +671,7 @@ Scenario: When a user is notified that a co-authored work has been inspired by a
Given a hidden collection "Hidden"
And I have related works setup
And I post a translation as translator
And I approve a related work
When I am logged in as "inspiration"
And I edit the work "Worldbuilding" to be in the collection "Hidden"
And I go to translator's related works page
Expand Down
Loading