hydra-tutorial 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/hydra-tutorial.gemspec
CHANGED
@@ -681,7 +681,7 @@ class HydraOpenRepositoriesTutorialApp < Thor::Group
|
|
681
681
|
end
|
682
682
|
|
683
683
|
def write_our_first_test
|
684
|
-
copy_file 'records_controller_spec.rb', 'spec/
|
684
|
+
copy_file 'records_controller_spec.rb', 'spec/controllers/records_controller_spec.rb'
|
685
685
|
end
|
686
686
|
|
687
687
|
def run_tests
|
@@ -692,6 +692,39 @@ class HydraOpenRepositoriesTutorialApp < Thor::Group
|
|
692
692
|
# copy_file 'record_test.rb', 'spec/models/record_test.rb'
|
693
693
|
end
|
694
694
|
|
695
|
+
def run_tests_again
|
696
|
+
run 'rspec'
|
697
|
+
end
|
698
|
+
|
699
|
+
def install_capybara
|
700
|
+
gem_group :development, :test do
|
701
|
+
gem 'capybara'
|
702
|
+
end
|
703
|
+
run 'bundle install'
|
704
|
+
# inject_into_file 'spec/spec_helper.rb' do
|
705
|
+
# " require 'capybara/rails'\n"
|
706
|
+
# end
|
707
|
+
end
|
708
|
+
|
709
|
+
def an_integration_test
|
710
|
+
copy_file 'integration_spec.rb', 'spec/integration/integration_spec.rb'
|
711
|
+
|
712
|
+
end
|
713
|
+
|
714
|
+
def run_tests_x3
|
715
|
+
run 'rspec'
|
716
|
+
end
|
717
|
+
|
718
|
+
def add_jettywrapper_ci_task
|
719
|
+
copy_file 'ci.rake', 'lib/tasks/ci.rake'
|
720
|
+
end
|
721
|
+
|
722
|
+
def run_ci_task
|
723
|
+
rake 'jetty:stop'
|
724
|
+
rake 'ci'
|
725
|
+
rake 'jetty:start'
|
726
|
+
end
|
727
|
+
|
695
728
|
end
|
696
729
|
|
697
730
|
class AddFileAssets < Thor::Group
|
@@ -0,0 +1,21 @@
|
|
1
|
+
desc "Run Continuous Integration Suite (tests, coverage, docs)"
|
2
|
+
task :ci do
|
3
|
+
Rake::Task["hydra:jetty:config"].invoke
|
4
|
+
|
5
|
+
require 'jettywrapper'
|
6
|
+
jetty_params = Jettywrapper.load_config.merge({
|
7
|
+
:jetty_home => File.expand_path(File.dirname(__FILE__) + '/../../jetty'),
|
8
|
+
:jetty_port => 8983,
|
9
|
+
:startup_wait => 25
|
10
|
+
})
|
11
|
+
|
12
|
+
Jettywrapper.wrap(jetty_params) do
|
13
|
+
Rails.env = "test"
|
14
|
+
Rake::Task['rspec'].invoke
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
desc "Run all specs"
|
19
|
+
RSpec::Core::RakeTask.new(:rspec) do |spec|
|
20
|
+
spec.rspec_opts = ["-c", "-r ./spec/spec_helper.rb"]
|
21
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Editing a record" do
|
4
|
+
it "" do
|
5
|
+
login_as('archivist1@example.com', 'test123')
|
6
|
+
end
|
7
|
+
it "Can edit basic content" do
|
8
|
+
register_and_login_as('archivist1@example.com')
|
9
|
+
|
10
|
+
visit new_record_path
|
11
|
+
|
12
|
+
fill_in "Title", :with => "This is my record title"
|
13
|
+
fill_in "Abstract", :with => "Abstract!"
|
14
|
+
click_button "save"
|
15
|
+
|
16
|
+
page.should have_content("This is my record title")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def logout
|
21
|
+
visit destroy_user_session_path
|
22
|
+
end
|
23
|
+
|
24
|
+
def login_as(email, password)
|
25
|
+
logout
|
26
|
+
|
27
|
+
visit new_user_session_path
|
28
|
+
fill_in "Email", :with => email
|
29
|
+
fill_in "Password", :with => password
|
30
|
+
click_button "Sign in"
|
31
|
+
end
|
32
|
+
|
33
|
+
def register email, password
|
34
|
+
visit "/users/sign_up"
|
35
|
+
|
36
|
+
fill_in "Email", :with => email
|
37
|
+
fill_in "Password", :with => password
|
38
|
+
fill_in "Password confirmation", :with => password
|
39
|
+
|
40
|
+
click_button "Sign up"
|
41
|
+
end
|
42
|
+
|
43
|
+
def register_and_login_as email, password='test123'
|
44
|
+
register email, password
|
45
|
+
login_as email, password
|
46
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-tutorial
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -74,6 +74,8 @@ files:
|
|
74
74
|
- bin/hydra-tutorial
|
75
75
|
- hydra-tutorial.gemspec
|
76
76
|
- open-repositories-tutorial.thor
|
77
|
+
- or_templates/add_tests/ci.rake
|
78
|
+
- or_templates/add_tests/integration_spec.rb
|
77
79
|
- or_templates/add_tests/records_controller_spec.rb
|
78
80
|
- or_templates/adding_our_models/basic_af_model.rb
|
79
81
|
- or_templates/adding_our_models/basic_mods_model.rb
|
@@ -109,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
111
|
version: '0'
|
110
112
|
segments:
|
111
113
|
- 0
|
112
|
-
hash: -
|
114
|
+
hash: -2847995408007673364
|
113
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
116
|
none: false
|
115
117
|
requirements:
|
@@ -118,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
120
|
version: '0'
|
119
121
|
segments:
|
120
122
|
- 0
|
121
|
-
hash: -
|
123
|
+
hash: -2847995408007673364
|
122
124
|
requirements: []
|
123
125
|
rubyforge_project:
|
124
126
|
rubygems_version: 1.8.24
|