diff options
author | winniehell <git@winniehell.de> | 2017-02-14 03:09:57 +0300 |
---|---|---|
committer | winniehell <git@winniehell.de> | 2017-02-14 14:04:35 +0300 |
commit | d8517fd457995927f8a2196e9dba1b6d68d027ad (patch) | |
tree | a0dec365a07a3472c6af9b679451cd31fc9bd599 /spec/javascripts/fixtures | |
parent | b06ac70ab5fec093bf189e8d0efb6ddb22796051 (diff) |
Replace static fixture for right_sidebar_spec.js (!9211)
Diffstat (limited to 'spec/javascripts/fixtures')
-rw-r--r-- | spec/javascripts/fixtures/.gitignore | 1 | ||||
-rw-r--r-- | spec/javascripts/fixtures/todos.json | 4 | ||||
-rw-r--r-- | spec/javascripts/fixtures/todos.rb | 40 |
3 files changed, 32 insertions, 13 deletions
diff --git a/spec/javascripts/fixtures/.gitignore b/spec/javascripts/fixtures/.gitignore index 009b68d5d1c..0c35cdd778e 100644 --- a/spec/javascripts/fixtures/.gitignore +++ b/spec/javascripts/fixtures/.gitignore @@ -1 +1,2 @@ *.html.raw +*.json diff --git a/spec/javascripts/fixtures/todos.json b/spec/javascripts/fixtures/todos.json deleted file mode 100644 index 62c2387d515..00000000000 --- a/spec/javascripts/fixtures/todos.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "count": 1, - "delete_path": "/dashboard/todos/1" -}
\ No newline at end of file diff --git a/spec/javascripts/fixtures/todos.rb b/spec/javascripts/fixtures/todos.rb index 30ccf49e7e8..2c08b06ea9e 100644 --- a/spec/javascripts/fixtures/todos.rb +++ b/spec/javascripts/fixtures/todos.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Dashboard::TodosController, '(JavaScript fixtures)', type: :controller do +describe 'Todos (JavaScript fixtures)' do include JavaScriptFixturesHelpers let(:admin) { create(:admin) } @@ -11,20 +11,42 @@ describe Dashboard::TodosController, '(JavaScript fixtures)', type: :controller let(:issue_2) { create(:issue, title: 'issue_2', project: project) } let!(:todo_2) { create(:todo, :done, user: admin, project: project, target: issue_2, created_at: 50.hours.ago) } - render_views - before(:all) do clean_frontend_fixtures('todos/') end - before(:each) do - sign_in(admin) + describe Dashboard::TodosController, '(JavaScript fixtures)', type: :controller do + render_views + + before(:each) do + sign_in(admin) + end + + it 'todos/todos.html.raw' do |example| + get :index + + expect(response).to be_success + store_frontend_fixture(response, example.description) + end end - it 'todos/todos.html.raw' do |example| - get :index + describe Projects::TodosController, '(JavaScript fixtures)', type: :controller do + render_views + + before(:each) do + sign_in(admin) + end + + it 'todos/todos.json' do |example| + post :create, + namespace_id: namespace.path, + project_id: project.path, + issuable_type: 'issue', + issuable_id: issue_2.id, + format: 'json' - expect(response).to be_success - store_frontend_fixture(response, example.description) + expect(response).to be_success + store_frontend_fixture(response, example.description) + end end end |