Stan Hu
562242cb9d
Fix commit data retrieval when branch name has single quotes
...
Closes #1724
2015-07-26 03:47:01 -07:00
Douwe Maan
546731244a
Merge branch 'rs-security-spec-speed' into 'master'
...
Speed up security feature specs
Before: `rspec spec/features/security/ 0.12s user 0.04s system 0% cpu 3:38.00 total`
After: `rspec spec/features/security/ 0.12s user 0.04s system 0% cpu 1:40.58 total`
The majority of the speed improvements is from two things:
1. Instead of using our standard `login_as` helper in the matchers, we take advantage
of the `Warden::Test::Helpers` version of the method which bypasses the login form
and logs the user in directly. We were essentially testing that filling out the login
form works hundreds of times.
2. There were many tests that verified if a user of a certain access level
(master, owner, reporter, guest) had access to a resource. Unfortunately we were
creating every type of user for each test even though a test was only verifying one of
them at a time. Now the tests only create the one user role they're testing.
See merge request !1023
2015-07-22 09:22:43 +00:00
Robert Speicher
0d5cf111f3
Move custom matchers to their own files under spec/support/matchers
2015-07-22 00:01:17 -04:00
Robert Speicher
a2ecfdc585
Move access-related matchers to their own module
2015-07-22 00:01:17 -04:00
Robert Speicher
1fee24a361
Remove unused be_valid_commit matcher
2015-07-21 22:11:08 -04:00
Stan Hu
643557dabc
Fix 404 error in files view after deleting the last file in a repository
...
Closes #1362
2015-07-21 14:12:43 -07:00
Dmitriy Zaporozhets
87e6786aa0
Merge branch 'rs-fix-coverage' into 'master'
...
Move coverage-related setup back to spec_helper
These tools must be loaded before our regular Rails environment.
Partially reverts 57830201a9
See merge request !976
2015-07-14 09:03:03 +00:00
Robert Speicher
ce02bf9900
Move coverage-related setup back to spec_helper
...
These tools must be loaded before our regular Rails environment.
2015-07-13 22:41:47 -04:00
Robert Speicher
f3d4767d0c
Rename notice_added_references to create_new_cross_references!
2015-07-13 21:31:16 -04:00
Robert Speicher
cf7c57aaf5
Use stub_application_setting in a few more specs
...
These specs also failed when run by themselves before this change, so
we've likely got some kind of cross-test contamination going on.
2015-07-06 22:39:56 -04:00
Robert Speicher
42b643f057
Fix ApplicationHelper specs
...
There were several specs that were failing when run by themselves.
- Use the `helper` object, as per RSpec 3 standards
- Use `assign` to assign instance variables that helpers expect
- Add `StubConfiguration` support module
2015-06-30 17:47:53 -04:00
Robert Speicher
366799bbf1
Add spec/support/factory_girl
...
Just for consistency with our Capybara, DatabaseCleaner, WebMock, etc.
setups.
2015-06-30 17:47:53 -04:00
Dmitriy Zaporozhets
779646ef38
Fix rubocop issues after merge of recent master
...
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com >
2015-06-23 10:46:29 +02:00
Dmitriy Zaporozhets
f40b99d02e
Merge branch 'master' into rubocop-for-tests
...
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com >
Conflicts:
spec/features/issues_spec.rb
spec/models/forked_project_link_spec.rb
spec/models/hooks/service_hook_spec.rb
spec/models/hooks/web_hook_spec.rb
spec/models/project_services/hipchat_service_spec.rb
spec/requests/api/project_members_spec.rb
spec/requests/api/projects_spec.rb
spec/requests/api/system_hooks_spec.rb
spec/services/archive_repository_service_spec.rb
spec/support/matchers.rb
spec/tasks/gitlab/backup_rake_spec.rb
2015-06-23 10:44:03 +02:00
Stan Hu
9369adb93d
Fix Style/NonNilCheck cop violations
2015-06-22 22:26:41 -07:00
Robert Speicher
0bb320cfda
Fix Style/HashSyntax violations
2015-06-22 14:54:33 -04:00
Robert Speicher
4dbf118a16
Fix Style/Not cop violations
2015-06-22 14:52:41 -04:00
Robert Speicher and Dmitriy Zaporozhets
1dd42da802
Add sleep call before yield in allowing_for_delay
...
This is to give pending AJAX requests time to complete before we
navigate away, for example.
2015-06-22 12:13:49 +02:00
Robert Speicher and Dmitriy Zaporozhets
8b1f1ab32e
Remove junk from db_cleaner spec support file
2015-06-22 12:13:47 +02:00
Robert Speicher and Dmitriy Zaporozhets
da135119aa
Move CapybaraHelpers to its own support file
...
In case we end up wanting to use it in Spinach as well.
2015-06-22 12:13:47 +02:00
Robert Speicher and Dmitriy Zaporozhets
2120e2dd95
Replace remaining references to Note.create_cross_reference_note
2015-06-22 12:13:46 +02:00
Robert Speicher and Dmitriy Zaporozhets
1f7490a23f
Update spec/features/security specs
2015-06-22 12:13:46 +02:00
Robert Speicher and Dmitriy Zaporozhets
5a9ede4721
Update mock and stub syntax for specs
2015-06-22 12:13:46 +02:00
Robert Speicher and Dmitriy Zaporozhets
9874cf5953
Fix include_module matcher
2015-06-22 12:13:46 +02:00
Stan Hu
e785b9d2e2
Fix Error 500 when one user attempts to access a personal, internal snippet
...
Closes #1815
2015-06-19 21:23:46 -07:00
Robert Speicher
b00f447db4
Add allowing_for_delay helper method for feature specs
2015-06-14 20:33:29 -04:00
Robert Speicher
44d6815999
Allow login_as helper to accept a User object
2015-06-13 17:58:15 -04:00
Robert Speicher
1f9a2ab7c9
Memoize result of JSON.parse in json_response
...
This might see a minor speedup in test cases that call this method many
times.
2015-06-10 01:31:27 -04:00
Robert Speicher
57830201a9
Add spec/support files for WebMock and test coverage
2015-06-10 01:31:27 -04:00
Robert Speicher
47251b85e0
ensure_length_of -> validate_length_of
2015-06-10 01:31:26 -04:00
Dmitriy Zaporozhets
79aac2c128
Merge branch 'ignore-references' into 'master'
...
Don't notify users mentioned in code blocks or blockquotes.
cc @rspeicher
See merge request !753
2015-06-02 18:39:18 +00:00
Robert Speicher
79c4e3899f
Rename ReferenceFilterSpecHelper to FilterSpecHelper
...
And make it more generalized for all filter specs.
2015-06-02 13:27:53 -04:00
Douwe Maan
a916936f3f
Fix spec.
2015-06-02 15:00:51 +02:00
Robert Speicher
94af050117
Use to_reference in reference filter specs
2015-05-26 15:48:32 -04:00
Robert Speicher
91eb346de6
Add invalidate_reference to ReferenceFilterSpecHelper
2015-05-26 15:48:31 -04:00
Robert Speicher
3b80cf524c
Use to_reference in Mentionable shared examples
2015-05-26 15:48:30 -04:00
Robert Speicher
1108915f75
Change wording for task list summaries
2015-05-06 17:27:10 -04:00
Robert Speicher
e167f28549
Update Taskable to use TaskList
2015-05-06 12:58:28 -04:00
Robert Speicher
1c49809bf8
Don't delete gitlab-test-fork folder after every test run
2015-05-02 16:01:33 -04:00
Dmitriy Zaporozhets
6d22e96744
Merge branch 'fix-submodule-error-with-forked-project' into 'master'
...
Fix "Revspec not found" errors when viewing diffs in a forked project with submodules
## What does this MR do?
This MR fixes an error that occurs when viewing diffs in a forked project with submodules.
### Are there points in the code the reviewer needs to double check?
Testing this code was tricky. The only way this problem shows up is if the origin project does NOT have the submodule update commit. The introduction of gitlab-test-fork serves that purpose: it contains a submodule update not present in gitlab-test.
### Why was this MR needed?
A user would receive a 500 error when trying to view a merge request with a submodule update. #1413 has details on how to reproduce this issue.
### What are the relevant issue numbers / [Feature requests](http://feedback.gitlab.com/ )?
#1413
See merge request !512
2015-04-30 16:47:35 +00:00
Dmitriy Zaporozhets
8140c68289
Merge branch 'rs-issue-2269' into 'master'
...
Remove duplicate settings for default_url_options
Closes #2269
See merge request !1797
2015-04-28 08:34:34 +00:00
Stan Hu
72a7febead
Fix "Revspec not found" errors when viewing diffs in a forked project with submodules
...
Closes #1413
2015-04-27 20:42:38 -07:00
Robert Speicher
e3d2304d69
Specs don't need to set default_url_options anymore
2015-04-27 15:47:05 -04:00
Robert Speicher
652c15b585
Don't use capybara-screenshot in CI environments
2015-04-25 21:33:17 -04:00
Robert Speicher
3875930793
Enable js_errors for Capybara in Spinach and RSpec
2015-04-25 21:33:16 -04:00
Robert Speicher
86edfce442
Move RSpec setup for Capybara to its own support file
2015-04-25 21:33:16 -04:00
Robert Speicher
89775da8e5
Add to_param to mentionable spec's mock
2015-04-25 14:40:40 -04:00
Robert Speicher
85082de780
Add pipeline_result to ReferenceFilterSpecHelper
2015-04-25 14:39:44 -04:00
Douwe Maan
077a8ec270
Fix tests.
2015-04-24 12:31:57 +02:00
Douwe Maan
889832578a
Fix small issues.
2015-04-24 12:31:16 +02:00