summaryrefslogtreecommitdiff
path: root/spec/features/ide/user_commits_changes_spec.rb
blob: f53abde15237f527200a683a550f9024c4ff243e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# frozen_string_literal: true

require 'spec_helper'

describe 'IDE user commits changes', :js do
  include WebIdeSpecHelpers

  let(:project) { create(:project, :public, :repository) }
  let(:user) { project.owner }

  before do
    sign_in(user)

    ide_visit(project)
  end

  it 'user updates nested files' do
    content = <<~HEREDOC
      Lorem ipsum
      Dolar sit
      Amit
    HEREDOC

    ide_create_new_file('foo/bar/lorem_ipsum.md', content: content)
    ide_delete_file('foo/bar/.gitkeep')

    ide_commit

    expect(page).to have_content('All changes are committed')
    expect(project.repository.blob_at('master', 'foo/bar/.gitkeep')).to be_nil
    expect(project.repository.blob_at('master', 'foo/bar/lorem_ipsum.md').data).to eql(content)
  end
end