Remove minitest-rails-capybara and convert feature tests to system tests
This commit is contained in:
parent
effb1b7f41
commit
3115fd41b1
6 changed files with 4 additions and 33 deletions
40
test/system/issues_test.rb
Normal file
40
test/system/issues_test.rb
Normal file
|
@ -0,0 +1,40 @@
|
|||
require "application_system_test_case"
|
||||
|
||||
class IssuesTest < ApplicationSystemTestCase
|
||||
def test_view_issues_normal_user
|
||||
sign_in_as(create(:user))
|
||||
|
||||
visit issues_path
|
||||
assert page.has_content?(I18n.t("application.require_admin.not_an_admin"))
|
||||
end
|
||||
|
||||
def test_view_no_issues
|
||||
sign_in_as(create(:moderator_user))
|
||||
|
||||
visit issues_path
|
||||
assert page.has_content?(I18n.t(".issues.index.search.issues_not_found"))
|
||||
end
|
||||
|
||||
def test_view_issues
|
||||
sign_in_as(create(:moderator_user))
|
||||
issues = create_list(:issue, 3, :issue_type => "moderator")
|
||||
|
||||
visit issues_path
|
||||
assert page.has_content?(issues.first.reported_user.display_name)
|
||||
end
|
||||
|
||||
def test_commenting
|
||||
issue = create(:issue)
|
||||
sign_in_as(create(:moderator_user))
|
||||
|
||||
visit issue_path(issue)
|
||||
|
||||
fill_in :issue_comment_body, :with => "test comment"
|
||||
click_on "Submit"
|
||||
assert page.has_content?(I18n.t(".issues.comment.comment_created"))
|
||||
assert page.has_content?("test comment")
|
||||
|
||||
issue.reload
|
||||
assert_equal issue.comments.first.body, "test comment"
|
||||
end
|
||||
end
|
31
test/system/report_diary_entry_test.rb
Normal file
31
test/system/report_diary_entry_test.rb
Normal file
|
@ -0,0 +1,31 @@
|
|||
require "application_system_test_case"
|
||||
|
||||
class ReportDiaryEntryTest < ApplicationSystemTestCase
|
||||
def setup
|
||||
create(:language, :code => "en")
|
||||
@diary_entry = create(:diary_entry)
|
||||
end
|
||||
|
||||
def test_no_flag_when_not_logged_in
|
||||
visit diary_entry_path(@diary_entry.user.display_name, @diary_entry)
|
||||
assert page.has_content?(@diary_entry.title)
|
||||
|
||||
assert !page.has_content?("\u2690")
|
||||
end
|
||||
|
||||
def test_it_works
|
||||
sign_in_as(create(:user))
|
||||
visit diary_entry_path(@diary_entry.user.display_name, @diary_entry)
|
||||
assert page.has_content? @diary_entry.title
|
||||
|
||||
click_on "\u2690"
|
||||
assert page.has_content? "Report"
|
||||
assert page.has_content? I18n.t("issues.new.disclaimer.intro")
|
||||
|
||||
choose "report_type__SPAM" # FIXME: use label text when the radio button labels are working
|
||||
fill_in "report_details", :with => "This is advertising"
|
||||
click_on "Save changes"
|
||||
|
||||
assert page.has_content? "Your report has been registered sucessfully"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue