makes commenting commentable independent
This commit is contained in:
@@ -44,13 +44,14 @@ module CommonActions
|
|||||||
click_button 'Send me reset password'
|
click_button 'Send me reset password'
|
||||||
end
|
end
|
||||||
|
|
||||||
def comment_on(debate, user = nil)
|
def comment_on(commentable, user = nil)
|
||||||
user ||= create(:user)
|
user ||= create(:user)
|
||||||
|
|
||||||
login_as(user)
|
login_as(user)
|
||||||
visit debate_path(debate)
|
commentable_path = commentable.is_a?(Proposal) ? proposal_path(commentable) : debate_path(commentable)
|
||||||
|
visit commentable_path
|
||||||
|
|
||||||
fill_in "comment-body-debate_#{debate.id}", with: 'Have you thought about...?'
|
fill_in "comment-body-#{commentable.class.name.downcase}_#{commentable.id}", with: 'Have you thought about...?'
|
||||||
click_button 'Publish comment'
|
click_button 'Publish comment'
|
||||||
|
|
||||||
expect(page).to have_content 'Have you thought about...?'
|
expect(page).to have_content 'Have you thought about...?'
|
||||||
|
|||||||
Reference in New Issue
Block a user