diff options
author | Renaud Chaput <renchap@gmail.com> | 2023-07-28 23:09:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-28 23:09:49 +0200 |
commit | 4d1b67f664e463f28ff45b8e125998ffcd2de50b (patch) | |
tree | afe51e0b714338a3472b94f8d1d838c0bbc4859e /spec/system/new_statuses_spec.rb | |
parent | 8d5d707cc1b7ca5461f628bde1e59e0c2096a771 (diff) |
Add end-to-end (system) tests (#25461)
Diffstat (limited to 'spec/system/new_statuses_spec.rb')
-rw-r--r-- | spec/system/new_statuses_spec.rb | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/spec/system/new_statuses_spec.rb b/spec/system/new_statuses_spec.rb new file mode 100644 index 00000000000..6faed6c808c --- /dev/null +++ b/spec/system/new_statuses_spec.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe 'NewStatuses' do + include ProfileStories + + subject { page } + + let(:email) { 'test@example.com' } + let(:password) { 'password' } + let(:confirmed_at) { Time.zone.now } + let(:finished_onboarding) { true } + + before do + as_a_logged_in_user + visit root_path + end + + it 'can be posted' do + expect(subject).to have_css('div.app-holder') + + status_text = 'This is a new status!' + + within('.compose-form') do + fill_in "What's on your mind?", with: status_text + click_on 'Publish!' + end + + expect(subject).to have_selector('.status__content__text', text: status_text) + end + + it 'can be posted again' do + expect(subject).to have_css('div.app-holder') + + status_text = 'This is a second status!' + + within('.compose-form') do + fill_in "What's on your mind?", with: status_text + click_on 'Publish!' + end + + expect(subject).to have_selector('.status__content__text', text: status_text) + end +end |