Commit graph

732 commits

Author SHA1 Message Date
shlok007
ad3d6f2f95 modify admin/conference_controller_spec and not authorized error messages 2017-06-28 06:55:30 +05:30
shlok007
aa3df0243e mending permissions and test 2017-06-28 06:55:30 +05:30
shlok007
b72e64b238 Introduce organization admins 2017-06-28 06:55:30 +05:30
AEtherC0r3
f37d3095e1 Rework cfp abilities 2017-06-27 21:16:46 +03:00
AEtherC0r3
a1124546f1 Fix rspec tests because of the changes to the cfp
Remove redundant association
Note: a conference created with :full_conference already has a cfp
2017-06-27 21:16:46 +03:00
AEtherC0r3
c3eb178546 Modify CFP to accept proposals for other things
Add field cfp_type and relevant validations
Add Program#cfp to preserve backwards compatibility
Add 'for_events' scope to the cfp, in order for it to be used like
program.cfps.events
Add useful methods
Add rspec test for the new code
The supported cfp types can be viewed via Cfp::TYPES
2017-06-27 21:16:46 +03:00
Ana María Martínez Gómez
905f8954d0 Fix broken test in Admin::EventsController
We are using `paper_trail` gem, which saves data in database table
versions. It has a native way to search in the versions records,
using `where_object()` and `where_object_changes()`. They are broken,
under certain conditions. We changed them to a manual `where()`.

To test this case we need: an Event with ID 1, an Event with ID 2, and
a commercial with ID 1, for event with ID 2 - obviously the numbers
could be different as long as there is this matching of IDs. Before
this was made wit ha expect, which would make the test fail if this is
not the case. But this is actually the test case, not what we want to
test, so I moved to the `let`.

This was also the case why one of the test was broken after we change
how the database is cleaned in:

https://github.com/openSUSE/osem/pull/1541

I also remove the feature test, as this should be tested in a
controller test.
2017-06-26 15:35:05 +02:00
Siddhant Bajaj
d7678b2fa0 Added model test
Added test for physical ticket model.
2017-06-22 19:51:08 +05:30
Siddhant Bajaj
5c56683ae8 Introduced Physical Ticket
Added PhysicalTicket model and controller. It holds the information about each physical ticket bought at the purchase. Physical Tickets are created after every successfull payment.
2017-06-22 19:50:55 +05:30
siddhantbajaj
0496ed23e5 Improves test speed 2017-06-15 04:26:15 +05:30
divyanshumehta
cdf794ecbf Add Style/SelfAssignment Rubocop cop
The cop enforces use of self assignment operator E.g. a=a+2 gets
written as a+=2. Also the offenses listed in rubocop.todo.yml
have been corrected automatically with the --auto-correct option.
Fixes issue #1531
2017-06-14 09:22:19 +05:30
shlok007
6cf9ddbdea fix failing test 2017-06-12 19:43:44 +05:30
shlok007
521c05af61 skip failing tests 2017-06-12 19:43:44 +05:30
shlok007
cce3ff7aea creating default organization while creating a conference 2017-06-12 19:43:44 +05:30
shlok007
3fb316482c suggested changes 2017-06-12 19:43:44 +05:30
shlok007
8edf896d86 introduce organizations 2017-06-12 19:43:44 +05:30
AEtherC0r3
7a7fcced48 Replace .today with .current in program spec
The cfp_open? method uses Date.current, so it should also be tested with
Date.current and not Date.today
Also, build was replaced with create to fix a false negative

This is a partial fix for #1522
2017-06-07 15:04:07 +03:00
nasia
6cb11ff2f3 Add Style/WordArray at rubocop.yml #1463 2017-06-06 13:53:05 +03:00
Agrim Mittal
255744268b shift relevant functions to versions_helper 2017-05-26 15:47:01 +03:00
hitman
8320f78d0b add test for new helpers 2017-05-26 15:47:01 +03:00
hitman
d9925f00e9 add volunteers helper 2017-05-26 15:47:01 +03:00
AEtherC0r3
fa56ff7f6d Add helper function for speaker selection
The line '@users = User.all.order(:name)' is replicated a lot of times
in EventsController and ProposalsController.
So, this commit removes it and adds a helper function
'speaker_selector_input' that generates the field where the @users
variable was used.
Also, it makes the query more specific.

Fix #1455

Other changes:
* Include the username in the drop down menu
* Add .active scope to User and corresponding tests
* Add :disabled trait to User factory
2017-05-20 18:27:07 +03:00
hitman
e73baa2754 add validation for name, used and quantity 2017-05-13 18:30:30 +03:00
AEtherC0r3
dbf7b73d1a Test ConferenceRegistration#new behaviour
Create shared example for when the user can create a new registration
Change older tests to use the shared example
Add tests for confirmed speakers
2017-05-13 17:47:22 +03:00
Siddhant Bajaj
1c12200003 Fixed paper trail inconsistent results for numeric values
There is a known issue in paper_trail that whenever we Query the
'versions.object' column it evaluates inconsistent results for numeric
values due to limitations of SQL wildcard matchers against the
serialized objects. So to fix this issue I have manually formed the where
query instead of using where_object and where_object_changes. I have
also added test for the same.
Fixes #1307
2017-05-11 14:01:52 +03:00
Eugene Dubinin
93404d543f implement user creation by admin 2017-05-08 22:54:02 +03:00
AEtherC0r3
95b88be061 Add tests for openid signup with every provider
The spec for omniauth doesn't test signup for every provider, and it
doesn't test if it has tests for all available providers
Also, we no longer use secrets

* Add model test to check if the omniauth providers have changed
* Test signup using every provider
* Replace secretswith environment variables
2017-05-06 10:37:58 +03:00
AEtherC0r3
9341edd9cb Change mock accounts credentials
The names and usernames don't follow a canonical pattern
And the emails point to a valid domain not owned by osem and not
reserved for illustration purposes

Normalize the users' names and usernames and change the domain of the
email addresses to example.com

Fix #1365
2017-05-06 10:37:58 +03:00
Siddhant Bajaj
7ce816e146 Fixed DeleteEventSchedules issue
Issues with DeleteEventSchedules method in conference controller:
1.It deletes EventSchedules of all the conferences that are not in the
hours range. Instead it should delete EventSchedules of those events
only that belong to that particular conference only.
2.If we set invalid start or end hour attribute of a conference then
also EventSchedules gets deleted even though conference is not
successfully updated.
Fixed both the issues and added test for the same.
2017-04-25 18:00:24 +05:30
Ana María Martínez Gómez
8dbe9ceb01 Merge pull request #1337 from siddhantbajaj/Validation
Added validation in EventSchedule model
2017-04-24 10:55:43 +02:00
nasia
a6e8283bcf Fix commercial option for users in dashboard#show #1390 2017-04-24 10:16:39 +03:00
Siddhant Bajaj
23473e1476 Added hour transient attribute to event_scheduled factory
It allows event_scheduled to be created with custom time.
2017-04-22 01:28:49 +05:30
Siddhant Bajaj
95d459f058 Added validation in EventSchedule model and test in event_schedule_spec
EventSchedule start time should be in hours range of the conference.Therefore it adds validation on start_time attribute of event schedule model. It also adds test for the same.
2017-04-22 01:20:05 +05:30
Siddhant Bajaj
cd9f329939 Fixed Confirmed Scheduled Events issue
Fixed issues with scheduled_event_distribution method in conference.rb
and added test in conference_spec.rb to confirm issue is fixed.
Fixes #1302
2017-04-18 18:30:42 +05:30
shlok007
f04c7a7cab improved features/ability_spec.rb 2017-04-14 14:51:21 +00:00
Stella Rouzi
92cb010cc6 Merge pull request #1448 from nasia-sam/cfp_access_to_schedule
Add permission to access admin/shedule by cfp #1432
2017-04-14 17:14:21 +03:00
nasia
11938025cf Add permission to access admin/shedule by cfp#1432 2017-04-13 20:45:19 +03:00
Eugene Dubinin
790e2fd3a2 implement manual event management and support for multiple speakers per event 2017-04-13 17:15:21 +03:00
Ana María Martínez Gómez
46a6a59622 Merge pull request #1430 from codyborders/master
Adds Style/Tab cop to rubocop.yml
2017-04-07 18:50:22 +02:00
Ana María Martínez Gómez
fd6d0bf39b Merge pull request #1446 from sunny-b/master
Enable Style/DotPosition Rubocop cop
2017-04-07 11:21:34 +02:00
Sunny
03fa299058 enable style/dotposition rubocop cop 2017-04-06 23:19:58 -04:00
Cody Borders
535b3f86d6 Fixes Style/Tab cops
Removes exclusions for Style/Tab cops in rubocop_todo
Places Style/Tab cop in appropriate alphabetical order
All cops now fixed.
2017-04-06 10:57:44 -06:00
gotens1211
eb1e8ed238 Changed the default state of components in splashpage to selected
Mark the splashpage components to checked for the new action, also modified the display changes in splashpages test

Fixes #1340
2017-04-05 17:11:11 +05:30
JewelSam
f6e74461ba Add schedule interval as attribute of a program
Also, the part of the schedule event is deleted and the length of the event types
changes to the nearest suitable after changing the length of the interval.

This closes #1220
2017-04-01 21:39:20 +03:00
Siddhant Bajaj
e8aa7c8a98 Fixed Venue link in todo list for organiser
"Add venue" link in todo list is not active for the organiser of that
conference. Fixes #1383
2017-03-26 00:25:44 +05:30
Stella Rouzi
8fb29972da Merge pull request #1268 from shlok007/tests
Added feature tests for Roles
2017-03-21 13:13:15 +02:00
Alberto Miedes Garcés
9d4c02cdb0 Improve test coverage for User model
* Wrote specs for `User#attended_event?`
* Wrote specs for `User#registered_to_event?
2017-03-17 11:26:47 +01:00
gotens1211
3ef17e921f Removed the View Tests 2017-03-13 13:33:07 +05:30
gotens1211
8e4cca980e removed the render banners component test 2017-03-12 18:31:05 +05:30
Stella Rouzi
77c7bdfecf Merge pull request #1266 from AEtherC0r3/fix_unreachable_code
Remove the unreachable code and modify the error message in ConferenceRegistrationsController#new
2017-03-08 10:55:27 +02:00