diff options
Diffstat (limited to 'spec/features/projects/snippets')
-rw-r--r-- | spec/features/projects/snippets/create_snippet_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/features/projects/snippets/create_snippet_spec.rb b/spec/features/projects/snippets/create_snippet_spec.rb index 94af023e804..5a425fb5d27 100644 --- a/spec/features/projects/snippets/create_snippet_spec.rb +++ b/spec/features/projects/snippets/create_snippet_spec.rb @@ -8,9 +8,17 @@ describe 'Projects > Snippets > Create Snippet', :js do let(:user) { create(:user) } let(:project) { create(:project, :public) } + def description_field + find('.js-description-input input,textarea') + end + def fill_form fill_in 'project_snippet_title', with: 'My Snippet Title' + + # Click placeholder first to expand full description field + description_field.click fill_in 'project_snippet_description', with: 'My Snippet **Description**' + page.within('.file-editor') do find('.ace_text-input', visible: false).send_keys('Hello World!') end @@ -27,6 +35,18 @@ describe 'Projects > Snippets > Create Snippet', :js do click_on('New snippet') end + it 'shows collapsible description input' do + collapsed = description_field + + expect(page).not_to have_field('project_snippet_description') + expect(collapsed).to be_visible + + collapsed.click + + expect(page).to have_field('project_snippet_description') + expect(collapsed).not_to be_visible + end + it 'creates a new snippet' do fill_form click_button('Create snippet') |