Commit 84935c9425942a53c214b7bb05c729607398f1d4
1 parent
a8df9e37
Exists in
master
and in
3 other branches
Skip validation of parent archived for responses
Showing
2 changed files
with
26 additions
and
0 deletions
Show diff stats
lib/proposals_discussion_plugin/response.rb
@@ -24,4 +24,9 @@ class ProposalsDiscussionPlugin::Response < TinyMceArticle | @@ -24,4 +24,9 @@ class ProposalsDiscussionPlugin::Response < TinyMceArticle | ||
24 | end | 24 | end |
25 | end | 25 | end |
26 | 26 | ||
27 | + def parent_archived? | ||
28 | + # skip parent archived validation for responses | ||
29 | + false | ||
30 | + end | ||
31 | + | ||
27 | end | 32 | end |
@@ -0,0 +1,21 @@ | @@ -0,0 +1,21 @@ | ||
1 | +require_relative '../test_helper' | ||
2 | + | ||
3 | +class ResponseTest < ActiveSupport::TestCase | ||
4 | + | ||
5 | + def setup | ||
6 | + @profile = fast_create(Community) | ||
7 | + @person = fast_create(Person) | ||
8 | + @discussion = ProposalsDiscussionPlugin::Discussion.create!(:name => 'discussion', :profile => person, :allow_topics => false) | ||
9 | + @topic = ProposalsDiscussionPlugin::Topic.create!(:name => 'topic', :profile => person, :parent => @discussion) | ||
10 | + @proposal = ProposalsDiscussionPlugin::Proposal.create!(:name => 'test', :abstract => 'abstract', :profile => @profile, :parent => @topic) | ||
11 | + end | ||
12 | + | ||
13 | + attr_reader :profile, :proposal, :person, :discussion, :topic | ||
14 | + | ||
15 | + should 'accept response even if the topic is archived' do | ||
16 | + proposal.update_attribute(:archived, true) | ||
17 | + response = ProposalsDiscussionPlugin::Response.new(:name => 'response', :abstract => 'response', :body => 'body', :profile => profile, :parent => proposal) | ||
18 | + assert response.save | ||
19 | + end | ||
20 | + | ||
21 | +end |