summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLuke Bennett <lukeeeebennettplus@gmail.com>2016-09-27 22:08:05 +0100
committerFatih Acet <acetfatih@gmail.com>2016-10-01 00:01:47 +0300
commit70f7d2446a4ba9e301d0f7151a95a52e127f2423 (patch)
tree700869392db43b9d959fb8c889fecb0b51dd9f2c /spec
parent61afa65d4e5e1ea908d90e45364fbb4e0bcfeb56 (diff)
downloadgitlab-ce-70f7d2446a4ba9e301d0f7151a95a52e127f2423.tar.gz
Updated tests
Diffstat (limited to 'spec')
-rw-r--r--spec/features/projects/files/edit_file_soft_wrap_spec.rb32
1 files changed, 3 insertions, 29 deletions
diff --git a/spec/features/projects/files/edit_file_soft_wrap_spec.rb b/spec/features/projects/files/edit_file_soft_wrap_spec.rb
index 7ad90b4a89c..012befa7990 100644
--- a/spec/features/projects/files/edit_file_soft_wrap_spec.rb
+++ b/spec/features/projects/files/edit_file_soft_wrap_spec.rb
@@ -23,42 +23,16 @@ feature 'User uses soft wrap whilst editing file', feature: true, js: true do
let(:toggle_button) { find('.soft-wrap-toggle') }
- scenario 'user clicks the "No wrap" button and then "Soft wrap" button' do
+ scenario 'user clicks the "Soft wrap" button and then "No wrap" button' do
wrapped_content_width = get_content_width
toggle_button.click
- expect(toggle_button).to have_content 'Soft wrap'
- unwrapped_content_width = get_content_width
- expect(unwrapped_content_width).to be > wrapped_content_width
-
- toggle_button.click
expect(toggle_button).to have_content 'No wrap'
- expect(get_content_width).to be < unwrapped_content_width
- end
-
- scenario 'user adds a ".js" extension and then changes to a ".md" extension' do
- wrapped_content_width = get_content_width
-
- fill_in 'file_name', with: 'test_file-name.js'
- expect(toggle_button).to have_content 'Soft wrap'
unwrapped_content_width = get_content_width
- expect(unwrapped_content_width).to be > wrapped_content_width
-
- fill_in 'file_name', with: 'test_file-name.md'
- expect(toggle_button).to have_content 'No wrap'
- expect(get_content_width).to be < unwrapped_content_width
- end
-
- scenario 'user clicks "No wrap" and then changes to a ".md" extension' do
- wrapped_content_width = get_content_width
+ expect(unwrapped_content_width).to be < wrapped_content_width
toggle_button.click
expect(toggle_button).to have_content 'Soft wrap'
- unwrapped_content_width = get_content_width
- expect(unwrapped_content_width).to be > wrapped_content_width
-
- fill_in 'file_name', with: 'test_file-name.md'
- expect(toggle_button).to have_content 'Soft wrap'
- expect(unwrapped_content_width).to be == get_content_width
+ expect(get_content_width).to be > unwrapped_content_width
end
def get_content_width