Skip to content

Commit

Permalink
ADD: Like button system test (#7252)
Browse files Browse the repository at this point in the history
Part of #5316
  • Loading branch information
VladimirMikulic authored and SidharthBansal committed Jan 17, 2020
1 parent a71dba5 commit e15a4dd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/system/post_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ class PostTest < ApplicationSystemTestCase
page.assert_selector('.tags-list p.badge', :count => 0)
end

test 'like button on the post' do
visit '/wiki/wiki-page-path/comments'

find('a[data-target="#loginModal"]', text: 'Login').click()

fill_in 'user_session[username]', with: 'jeff'
fill_in 'user_session[password]', with: 'secretive'

click_on 'Log in'

like_button = find('.btn-like').click();

# Make sure that star is toggled
assert has_no_selector?('.btn-like .fa.fa-star-o')
end

# Utility methods:

def assert_page_reloads(message = "page should reload")
Expand Down

0 comments on commit e15a4dd

Please sign in to comment.