Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cesswairimu committed Nov 28, 2019
1 parent 84d61f7 commit c8b5304
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
11 changes: 0 additions & 11 deletions test/system/screenshots_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,4 @@ class ScreenshotsTest < ApplicationSystemTestCase
visit node.path
take_screenshot
end

test 'simple editor post' do
visit '/'
click_on 'Login'
fill_in("username-login", with: "steff1")
fill_in("password-signup", with: "secretive")
click_on "Log in"
visit(simple_editor_path)
find('button#location_button').click
take_screenshot
end
end
27 changes: 27 additions & 0 deletions test/system/simple_post_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
require "application_system_test_case"

class SimplePostTest < ApplicationSystemTestCase
Capybara.default_max_wait_time = 60

test 'simple editor post' do
visit '/'
click_on 'Login'
fill_in('username-login', with: 'steff1')
fill_in('password-signup', with: 'secretive')
click_on 'Log in'
visit(simple_editor_path)

find('button#location_button').click
assert page.has_button?('Post', disabled: true)
assert page.has_button?('Help')
take_screenshot

fill_in('input#title_input', with: 'My story')
fill_in('text-area#text_input', with: 'What is different in Cranston today is the climate')
assert page.has_button?('Post', disabled: false)
find('button.ple-publish').click

assert_selector('h1', text: "My story")
assert_selector('#content', text: 'What is different in Cranston today is the climate')
end
end

0 comments on commit c8b5304

Please sign in to comment.