]> git.openstreetmap.org Git - rails.git/blob - test/features/report_diary_entry_test.rb
aaa89ad5b8c30a15d0f79b66f2bad321b86243ab
[rails.git] / test / features / report_diary_entry_test.rb
1 require "test_helper"
2
3 class ReportDiaryEntryTest < Capybara::Rails::TestCase
4   def setup
5     create(:language, :code => "en")
6     @diary_entry = create(:diary_entry)
7   end
8
9   def test_it_works
10     sign_in_as(create(:user))
11     visit diary_entry_path(@diary_entry.user.display_name, @diary_entry)
12     assert page.has_content? @diary_entry.title
13
14     click_on "\u2690"
15     assert page.has_content? "Report"
16     assert page.has_content? I18n.t("issues.new.disclaimer.intro")
17
18     choose "report_type__SPAM" # FIXME: use label text when the radio button labels are working
19     fill_in "report_details", :with => "This is advertising"
20     click_on "Save changes"
21
22     assert page.has_content? "Your report has been registered sucessfully"
23   end
24 end