Skip to content

Commit

Permalink
Merge pull request otwcode#2485 from sarken/AO3-3597
Browse files Browse the repository at this point in the history
AO3-3597 Fix editing work language on preview, rename admin option
  • Loading branch information
zz9pzza committed Jun 13, 2016
2 parents 1a6311c + 500db9a commit e9d5917
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/views/admin/_admin_options.html.erb
Expand Up @@ -31,7 +31,7 @@
</li>
<% end %>
<% if @work.present? %>
<li><%= link_to ts("Edit Tags"), edit_tags_work_path(@work) %></li>
<li><%= link_to ts("Edit Tags and Language"), edit_tags_work_path(@work) %></li>
<% end %>
<% if item.class == ExternalWork %>
<li><%= link_to ts("Edit External Work"), edit_external_work_path(item) %></li>
Expand Down
1 change: 1 addition & 0 deletions app/views/works/preview_tags.html.erb
Expand Up @@ -19,6 +19,7 @@
<%= form.hidden_field :relationship_string, :value => "#{@work.relationship_string}" %>
<%= form.hidden_field :character_string, :value => "#{@work.character_string}" %>
<%= form.hidden_field :freeform_string, :value => "#{@work.freeform_string}" %>
<%= form.hidden_field :language_id, :value => "#{@work.language.id}" %>

<fieldset>
<legend><%= ts('Post Work') %></legend>
Expand Down
22 changes: 18 additions & 4 deletions features/admins/admin_works.feature
Expand Up @@ -70,7 +70,7 @@ Feature: Admin Actions for Works and Bookmarks
And I post the work "Changes" with fandom "User-Added Fandom" with freeform "User-Added Freeform" with category "M/M"
When I am logged in as an admin
And I view the work "Changes"
And I follow "Edit Tags"
And I follow "Edit Tags and Language"
When I select "Mature" from "Rating"
And I uncheck "No Archive Warnings Apply"
And I check "Choose Not To Use Archive Warnings"
Expand Down Expand Up @@ -189,15 +189,29 @@ Feature: Admin Actions for Works and Bookmarks
Then I should not see "rolex"
And I should see "I loved this!"

Scenario: Admin can edit language on works
Scenario: Admin can edit language on works when posting without previewing
Given basic tags
And basic languages
And I am logged in as "regular_user"
And I post the work "Wrong Language"
When I am logged in as an admin
And I view the work "Wrong Language"
And I follow "Edit Tags"
And I follow "Edit Tags and Language"
When I select "Deutsch" from "Choose a language"
And I press "Post Without Preview"
Then I should see "Deutsch"
And I should not see "English"
And I should not see "English"

Scenario: Admin can edit language on works when previewing first
Given basic tags
And basic languages
And I am logged in as "regular_user"
And I post the work "Wrong Language"
When I am logged in as an admin
And I view the work "Wrong Language"
And I follow "Edit Tags and Language"
When I select "Deutsch" from "Choose a language"
And I press "Preview"
And I press "Update"
Then I should see "Deutsch"
And I should not see "English"

0 comments on commit e9d5917

Please sign in to comment.