Skip to content

Commit

Permalink
Replace instances of #find(:all) with conditions with #where (see pap…
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanfb committed Jan 26, 2021
1 parent 6670e32 commit 3505788
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/integration/community_workflow_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,13 @@ class CommunityWorkflowTest < ActionDispatch::IntegrationTest
Rails.logger.debug "---Publication Submitted to Community: " + @publication.community.name

#meta board should have 1 publication, others should have 0
meta_publications = Publication.find(:all, :conditions => { :owner_id => @meta_board.id, :owner_type => "Board" } )
meta_publications = Publication.where(owner_id: @meta_board.id, owner_type: 'Board')
assert_equal 1, meta_publications.length, "Meta does not have 1 publication but rather, " + meta_publications.length.to_s + " publications"

text_publications = Publication.find(:all, :conditions => { :owner_id => @text_board.id, :owner_type => "Board" } )
text_publications = Publication.where(owner_id: @text_board.id, owner_type: 'Board')
assert_equal 0, text_publications.length, "Text does not have 0 publication but rather, " + text_publications.length.to_s + " publications"

translation_publications = Publication.find(:all, :conditions => { :owner_id => @translation_board.id, :owner_type => "Board" } )
translation_publications = Publication.where(owner_id: @translation_board.id, owner_type: 'Board')
assert_equal 0, translation_publications.length, "Translation does not have 0 publication but rather, " + translation_publications.length.to_s + " publications"

Rails.logger.debug "Community Meta Board has publication"
Expand All @@ -304,9 +304,9 @@ class CommunityWorkflowTest < ActionDispatch::IntegrationTest
:vote => { :publication_id => meta_identifier.publication.id.to_s, :identifier_id => meta_identifier.id.to_s, :user_id => @board_user.id.to_s, :board_id => @meta_board.id.to_s, :choice => "ok" }

Rails.logger.debug "--flash is: " + meta_session.flash.inspect

end

Rails.logger.debug "---Reloading publication: #{meta_publication.inspect}"
#reload the publication to get the vote associations to go thru?
meta_publication.reload
Expand Down Expand Up @@ -400,15 +400,15 @@ class CommunityWorkflowTest < ActionDispatch::IntegrationTest
#now text board should have it

#meta board should have 1 publication
meta_publications = Publication.find(:all, :conditions => { :owner_id => @meta_board.id, :owner_type => "Board" } )
meta_publications = Publication.where(owner_id: @meta_board.id, owner_type: 'Board')
assert_equal 1, meta_publications.length, "Meta does not have 1 publication but rather, " + meta_publications.length.to_s + " publications"

#text board should have 1 publication
text_publications = Publication.find(:all, :conditions => { :owner_id => @text_board.id, :owner_type => "Board" } )
text_publications = Publication.where(owner_id: @text_board.id, owner_type: 'Board')
assert_equal 1, text_publications.length, "Text does not have 0 publication but rather, " + text_publications.length.to_s + " publications"

#translation board should have 0 publication
translation_publications = Publication.find(:all, :conditions => { :owner_id => @translation_board.id, :owner_type => "Board" } )
translation_publications = Publication.where(owner_id: @translation_board.id, owner_type: 'Board')
assert_equal 0, translation_publications.length, "Translation does not have 0 publication but rather, " + translation_publications.length.to_s + " publications"

#vote on it
Expand Down

0 comments on commit 3505788

Please sign in to comment.