Commit 164750580547d1885175f8205a667cbdb2b8914e
1 parent
e842924b
Exists in
refactor_software_info_to_software
and in
1 other branch
Fix functional tests
Signed-off-by: Luciano Prestes Cavalcanti <lucianopcbr@gmail.com> Signed-off-by: Pedro de Lyra Pereira <pedrodelyra@gmail.com>
Showing
14 changed files
with
151 additions
and
142 deletions
Show diff stats
src/noosfero-spb/software_communities/controllers/software_communities_plugin_myprofile_controller.rb
... | ... | @@ -15,7 +15,7 @@ class SoftwareCommunitiesPluginMyprofileController < MyProfileController |
15 | 15 | @license_info = SoftwareCommunitiesPlugin::LicenseInfo.find_by_id(params[:license][:license_infos_id]) if params[:license] |
16 | 16 | @license_info ||= SoftwareCommunitiesPlugin::LicenseInfo.new |
17 | 17 | |
18 | - @software_info = SoftwareCommunitiesPlugin::SoftwareInfo.new(params[:software_info]) | |
18 | + @software_info = SoftwareCommunitiesPlugin::SoftwareInfo.new(params[:software_communities_plugin_software_info]) | |
19 | 19 | @software_info.community = @community |
20 | 20 | @software_info.license_info = @license_info |
21 | 21 | |
... | ... | @@ -103,6 +103,7 @@ class SoftwareCommunitiesPluginMyprofileController < MyProfileController |
103 | 103 | |
104 | 104 | def create_software |
105 | 105 | @software_info = @profile.software_info |
106 | + | |
106 | 107 | params[:software][:public_software] ||= false unless @software_info.public_software? |
107 | 108 | @license = SoftwareCommunitiesPlugin::LicenseInfo.find(params[:license][:license_infos_id]) |
108 | 109 | @software_info.license_info = @license |
... | ... | @@ -111,7 +112,7 @@ class SoftwareCommunitiesPluginMyprofileController < MyProfileController |
111 | 112 | another_license_version = nil |
112 | 113 | another_license_link = nil |
113 | 114 | if params[:license] |
114 | - @license = LicenseInfo.find(params[:license][:license_infos_id]) | |
115 | + @license = SoftwareCommunitiesPlugin::LicenseInfo.find(params[:license][:license_infos_id]) | |
115 | 116 | @software_info.license_info = @license |
116 | 117 | |
117 | 118 | another_license_version = params[:license][:version] |
... | ... | @@ -140,7 +141,7 @@ class SoftwareCommunitiesPluginMyprofileController < MyProfileController |
140 | 141 | another_license_link = params[:license][:link] |
141 | 142 | end |
142 | 143 | @software_info = SoftwareCommunitiesPlugin::SoftwareInfo.create_after_moderation(user, |
143 | - params[:software_info].merge({ | |
144 | + params[:software_communities_plugin_software_info].merge({ | |
144 | 145 | :environment => environment, |
145 | 146 | :name => params[:community][:name], |
146 | 147 | :identifier => params[:community][:identifier], |
... | ... | @@ -208,6 +209,7 @@ class SoftwareCommunitiesPluginMyprofileController < MyProfileController |
208 | 209 | @license_info.valid? if @license_info |
209 | 210 | add_software_erros |
210 | 211 | end |
212 | + end | |
211 | 213 | |
212 | 214 | def update_software_highlight_errors |
213 | 215 | @error_community_name = @community.errors.include?(:name) ? "highlight-error" : "" if @community | ... | ... |
src/noosfero-spb/software_communities/lib/ext/search_controller.rb
... | ... | @@ -33,6 +33,11 @@ class SearchController |
33 | 33 | @software_count = results.count |
34 | 34 | results = results.paginate(:per_page => @per_page, :page => params[:page]) |
35 | 35 | |
36 | + @asset = "software_communities_plugin/software_infos".to_sym | |
37 | + @assets = [@asset] | |
38 | + @searches[@asset] = @searches.delete(:software_infos) | |
39 | + @titles[@asset] = @titles.delete(:software_infos) | |
40 | + | |
36 | 41 | @searches[@asset] = {:results => results} |
37 | 42 | @search = results |
38 | 43 | ... | ... |
src/noosfero-spb/software_communities/lib/software_communities_plugin/license_helper.rb
1 | 1 | module SoftwareCommunitiesPlugin::LicenseHelper |
2 | 2 | def self.find_licenses query |
3 | 3 | licenses = SoftwareCommunitiesPlugin::LicenseInfo.where("version ILIKE ?", "%#{query}%").select("id, version") |
4 | - licenses.reject!{|license| license.version == "Another"} | |
4 | + licenses = licenses.reject { |license| license.version == "Another" } | |
5 | 5 | license_another = SoftwareCommunitiesPlugin::LicenseInfo.find_by_version("Another") |
6 | 6 | licenses << license_another if license_another |
7 | 7 | licenses | ... | ... |
src/noosfero-spb/software_communities/lib/software_communities_plugin/software_info.rb
... | ... | @@ -21,7 +21,7 @@ class SoftwareCommunitiesPlugin::SoftwareInfo < ActiveRecord::Base |
21 | 21 | SoftwareCommunitiesPlugin::SoftwareInfo.joins(:community).where("profiles.visible = ? AND environment_id = ? ", true, env.id) |
22 | 22 | else |
23 | 23 | searchable_software_objects = SoftwareCommunitiesPlugin::SoftwareInfo.transform_list_in_methods_list(SEARCHABLE_SOFTWARE_CLASSES) |
24 | - includes(searchable_software_objects).where("to_tsvector('simple', #{search_fields}) @@ to_tsquery('#{filtered_query}')").where("profiles.visible = ?", true) | |
24 | + includes(searchable_software_objects).where("to_tsvector('simple', #{search_fields}) @@ to_tsquery('#{filtered_query}')").where("profiles.visible = ?", true).references(searchable_software_objects) | |
25 | 25 | end |
26 | 26 | } |
27 | 27 | |
... | ... | @@ -29,10 +29,10 @@ class SoftwareCommunitiesPlugin::SoftwareInfo < ActiveRecord::Base |
29 | 29 | methods_list = [] |
30 | 30 | |
31 | 31 | list.each do |element| |
32 | - if SoftwareCommunitiesPlugin::SoftwareInfo.instance_methods.include?(element.to_s.underscore.to_sym) | |
33 | - methods_list << element.to_s.underscore.to_sym | |
34 | - elsif SoftwareCommunitiesPlugin::SoftwareInfo.instance_methods.include?(element.to_s.underscore.pluralize.to_sym) | |
35 | - methods_list << element.to_s.underscore.pluralize.to_sym | |
32 | + if SoftwareCommunitiesPlugin::SoftwareInfo.instance_methods.include?(element.to_s.gsub("SoftwareCommunitiesPlugin::", "").underscore.to_sym) | |
33 | + methods_list << element.to_s.gsub("SoftwareCommunitiesPlugin::", "").underscore.to_sym | |
34 | + elsif SoftwareCommunitiesPlugin::SoftwareInfo.instance_methods.include?(element.to_s.gsub("SoftwareCommunitiesPlugin::", "").underscore.pluralize.to_sym) | |
35 | + methods_list << element.to_s.gsub("SoftwareCommunitiesPlugin::", "").underscore.pluralize.to_sym | |
36 | 36 | end |
37 | 37 | end |
38 | 38 | |
... | ... | @@ -181,18 +181,20 @@ class SoftwareCommunitiesPlugin::SoftwareInfo < ActiveRecord::Base |
181 | 181 | another_license_link = attributes.delete(:another_license_link) |
182 | 182 | |
183 | 183 | software_info = SoftwareCommunitiesPlugin::SoftwareInfo.new(attributes) |
184 | - unless environment.admins.include? requestor | |
184 | + if !requestor.is_admin? | |
185 | 185 | SoftwareCommunitiesPlugin::CreateSoftware.create!( |
186 | 186 | attributes.merge( |
187 | 187 | :requestor => requestor, |
188 | 188 | :environment => environment, |
189 | 189 | :name => name, |
190 | 190 | :identifier => identifier, |
191 | - :license_info => license_info | |
191 | + :license_info => license_info, | |
192 | + :another_license_version => another_license_version, | |
193 | + :another_license_link => another_license_link | |
192 | 194 | ) |
193 | 195 | ) |
194 | 196 | else |
195 | - software_template = SoftwareCommunitiesPlugin::SoftwareHelper.software_template | |
197 | + software_template = Community["software"] | |
196 | 198 | |
197 | 199 | community_hash = {:name => name} |
198 | 200 | community_hash[:identifier] = identifier |
... | ... | @@ -201,7 +203,7 @@ class SoftwareCommunitiesPlugin::SoftwareInfo < ActiveRecord::Base |
201 | 203 | community = Community.new(community_hash) |
202 | 204 | community.environment = environment |
203 | 205 | |
204 | - unless software_template.blank? | |
206 | + if (!software_template.blank? && software_template.is_template) | |
205 | 207 | community.template_id = software_template.id |
206 | 208 | end |
207 | 209 | |
... | ... | @@ -210,10 +212,10 @@ class SoftwareCommunitiesPlugin::SoftwareInfo < ActiveRecord::Base |
210 | 212 | |
211 | 213 | software_info.community = community |
212 | 214 | software_info.license_info = license_info |
215 | + software_info.verify_license_info(another_license_version, another_license_link) | |
216 | + software_info.save! | |
213 | 217 | end |
214 | 218 | |
215 | - software_info.verify_license_info(another_license_version, another_license_link) | |
216 | - software_info.save | |
217 | 219 | software_info |
218 | 220 | end |
219 | 221 | ... | ... |
src/noosfero-spb/software_communities/lib/tasks/create_licenses.rake
... | ... | @@ -16,8 +16,8 @@ namespace :software do |
16 | 16 | |
17 | 17 | if data.length != 0 |
18 | 18 | if version_or_link == 'version' |
19 | - can_save = LicenseInfo.find_by_version(data) ? false : true | |
20 | - licence = LicenseInfo::new :version => data | |
19 | + can_save = SoftwareCommunitiesPlugin::LicenseInfo.find_by_version(data) ? false : true | |
20 | + licence = SoftwareCommunitiesPlugin::LicenseInfo::new :version => data | |
21 | 21 | version_or_link = 'link' |
22 | 22 | elsif version_or_link == 'link' |
23 | 23 | licence.link = data | ... | ... |
src/noosfero-spb/software_communities/test/functional/organization_ratings_plugin_profile_controller_test.rb
... | ... | @@ -18,12 +18,12 @@ class OrganizationRatingsPluginProfileControllerTest < ActionController::TestCas |
18 | 18 | @environment.enabled_plugins = ['SoftwareCommunitiesPlugin'] |
19 | 19 | @environment.save |
20 | 20 | |
21 | - LicenseInfo.create(:version=>"CC-GPL-V2", | |
21 | + SoftwareCommunitiesPlugin::LicenseInfo.create(:version=>"CC-GPL-V2", | |
22 | 22 | :link=>"http://creativecommons.org/licenses/GPL/2.0/legalcode.pt") |
23 | 23 | |
24 | 24 | @person = create_user('testuser').person |
25 | 25 | @software = create_software(software_fields) |
26 | - @statistic_block = StatisticBlock.new | |
26 | + @statistic_block = SoftwareCommunitiesPlugin::StatisticBlock.new | |
27 | 27 | @software.community.blocks << @statistic_block |
28 | 28 | @software.community.save! |
29 | 29 | ... | ... |
src/noosfero-spb/software_communities/test/functional/profile_editor_controller_test.rb
... | ... | @@ -15,7 +15,7 @@ class ProfileEditorControllerTest < ActionController::TestCase |
15 | 15 | @response = ActionController::TestResponse.new |
16 | 16 | @profile = create_user('default_user').person |
17 | 17 | |
18 | - LicenseInfo.create( | |
18 | + SoftwareCommunitiesPlugin::LicenseInfo.create( | |
19 | 19 | :version=>"CC-GPL-V2", |
20 | 20 | :link=>"http://creativecommons.org/licenses/GPL/2.0/legalcode.pt" |
21 | 21 | ) | ... | ... |
src/noosfero-spb/software_communities/test/functional/search_controller_test.rb
... | ... | @@ -21,8 +21,8 @@ class SearchControllerTest < ActionController::TestCase |
21 | 21 | @response = ActionController::TestResponse.new |
22 | 22 | |
23 | 23 | @licenses = [ |
24 | - LicenseInfo.create(:version => "GPL - 1"), | |
25 | - LicenseInfo.create(:version => "GPL - 2") | |
24 | + SoftwareCommunitiesPlugin::LicenseInfo.create(:version => "GPL - 1"), | |
25 | + SoftwareCommunitiesPlugin::LicenseInfo.create(:version => "GPL - 2") | |
26 | 26 | ] |
27 | 27 | |
28 | 28 | create_software_categories |
... | ... | @@ -32,8 +32,8 @@ class SearchControllerTest < ActionController::TestCase |
32 | 32 | @softwares << create_software_info("Software One", :acronym => "SFO", :finality => "Help") |
33 | 33 | @softwares << create_software_info("Software Two", :acronym => "SFT", :finality => "Task") |
34 | 34 | |
35 | - @softwares[0].community.categories << Category.first | |
36 | - @softwares[1].community.categories << Category.last | |
35 | + @softwares[0].community.categories << Category.all[0] | |
36 | + @softwares[1].community.categories << Category.all[1] | |
37 | 37 | |
38 | 38 | @softwares[0].license_info = @licenses.first |
39 | 39 | @softwares[1].license_info = @licenses.last |
... | ... | @@ -56,8 +56,8 @@ class SearchControllerTest < ActionController::TestCase |
56 | 56 | |
57 | 57 | get :software_infos, :query => "One" |
58 | 58 | |
59 | - assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community | |
60 | - assert_not_includes assigns(:searches)[:software_infos][:results], community | |
59 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], @softwares.first.community | |
60 | + assert_not_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], community | |
61 | 61 | end |
62 | 62 | |
63 | 63 | |
... | ... | @@ -83,11 +83,11 @@ class SearchControllerTest < ActionController::TestCase |
83 | 83 | get( |
84 | 84 | :software_infos, |
85 | 85 | :query => "", |
86 | - :selected_categories_id => [Category.first.id] | |
86 | + :selected_categories_id => [Category.all[0].id] | |
87 | 87 | ) |
88 | 88 | |
89 | - assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community | |
90 | - assert_not_includes assigns(:searches)[:software_infos][:results], @softwares.last.community | |
89 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], @softwares.first.community | |
90 | + assert_not_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], @softwares.last.community | |
91 | 91 | end |
92 | 92 | |
93 | 93 | should "software_infos search softwares with one or more selected categories" do |
... | ... | @@ -97,12 +97,12 @@ class SearchControllerTest < ActionController::TestCase |
97 | 97 | get( |
98 | 98 | :software_infos, |
99 | 99 | :query => "", |
100 | - :selected_categories_id => [Category.all[0], Category.all[1]] | |
100 | + :selected_categories_id => [Category.all[0].id, Category.all[1].id] | |
101 | 101 | ) |
102 | 102 | |
103 | - assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community | |
104 | - assert_includes assigns(:searches)[:software_infos][:results], @softwares.last.community | |
105 | - assert_not_includes assigns(:searches)[:software_infos][:results], software.community | |
103 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], @softwares.first.community | |
104 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], @softwares.last.community | |
105 | + assert_not_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], software.community | |
106 | 106 | end |
107 | 107 | |
108 | 108 | |
... | ... | @@ -118,8 +118,8 @@ class SearchControllerTest < ActionController::TestCase |
118 | 118 | :query => "python", |
119 | 119 | ) |
120 | 120 | |
121 | - assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community | |
122 | - assert_not_includes assigns(:searches)[:software_infos][:results], @softwares.last.community | |
121 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], @softwares.first.community | |
122 | + assert_not_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], @softwares.last.community | |
123 | 123 | end |
124 | 124 | |
125 | 125 | should "software_infos search by database description" do |
... | ... | @@ -134,8 +134,8 @@ class SearchControllerTest < ActionController::TestCase |
134 | 134 | :query => "mysql", |
135 | 135 | ) |
136 | 136 | |
137 | - assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community | |
138 | - assert_not_includes assigns(:searches)[:software_infos][:results], @softwares.last.community | |
137 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], @softwares.first.community | |
138 | + assert_not_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], @softwares.last.community | |
139 | 139 | end |
140 | 140 | |
141 | 141 | should "software_infos search by finality" do |
... | ... | @@ -145,8 +145,8 @@ class SearchControllerTest < ActionController::TestCase |
145 | 145 | ) |
146 | 146 | |
147 | 147 | |
148 | - assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community | |
149 | - assert_not_includes assigns(:searches)[:software_infos][:results], @softwares.last.community | |
148 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], @softwares.first.community | |
149 | + assert_not_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], @softwares.last.community | |
150 | 150 | end |
151 | 151 | |
152 | 152 | should "software_infos search by acronym" do |
... | ... | @@ -155,13 +155,13 @@ class SearchControllerTest < ActionController::TestCase |
155 | 155 | :query => "SFO", |
156 | 156 | ) |
157 | 157 | |
158 | - assert_includes assigns(:searches)[:software_infos][:results], @softwares.first.community | |
159 | - assert_not_includes assigns(:searches)[:software_infos][:results], @softwares.last.community | |
158 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], @softwares.first.community | |
159 | + assert_not_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], @softwares.last.community | |
160 | 160 | end |
161 | 161 | |
162 | 162 | should "software_infos search by relevance" do |
163 | 163 | @softwares << create_software_info("Software Three", :acronym => "SFW", :finality => "Java") |
164 | - @softwares.last.license_info = LicenseInfo.create :version => "GPL - 3.0" | |
164 | + @softwares.last.license_info = SoftwareCommunitiesPlugin::LicenseInfo.create :version => "GPL - 3.0" | |
165 | 165 | |
166 | 166 | |
167 | 167 | @softwares.first.software_languages << create_software_language("Java", "8.0") |
... | ... | @@ -176,9 +176,9 @@ class SearchControllerTest < ActionController::TestCase |
176 | 176 | :query => "Java" |
177 | 177 | ) |
178 | 178 | |
179 | - assert_equal assigns(:searches)[:software_infos][:results][0], @softwares[1].community | |
180 | - assert_equal assigns(:searches)[:software_infos][:results][1], @softwares[2].community | |
181 | - assert_equal assigns(:searches)[:software_infos][:results][2], @softwares[0].community | |
179 | + assert_equal assigns(:searches)[:"software_communities_plugin/software_infos"][:results][0], @softwares[1].community | |
180 | + assert_equal assigns(:searches)[:"software_communities_plugin/software_infos"][:results][1], @softwares[2].community | |
181 | + assert_equal assigns(:searches)[:"software_communities_plugin/software_infos"][:results][2], @softwares[0].community | |
182 | 182 | end |
183 | 183 | |
184 | 184 | should "software_infos search only public_software" do |
... | ... | @@ -193,9 +193,9 @@ class SearchControllerTest < ActionController::TestCase |
193 | 193 | :software_type => "public_software" |
194 | 194 | ) |
195 | 195 | |
196 | - assert_includes assigns(:searches)[:software_infos][:results], software_one.community | |
197 | - assert_includes assigns(:searches)[:software_infos][:results], software_two.community | |
198 | - assert_not_includes assigns(:searches)[:software_infos][:results], software_three.community | |
196 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], software_one.community | |
197 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], software_two.community | |
198 | + assert_not_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], software_three.community | |
199 | 199 | end |
200 | 200 | |
201 | 201 | should "software_infos search public_software and other all" do |
... | ... | @@ -210,9 +210,9 @@ class SearchControllerTest < ActionController::TestCase |
210 | 210 | :software_type => "all" |
211 | 211 | ) |
212 | 212 | |
213 | - assert_includes assigns(:searches)[:software_infos][:results], software_one.community | |
214 | - assert_includes assigns(:searches)[:software_infos][:results], software_two.community | |
215 | - assert_includes assigns(:searches)[:software_infos][:results], software_three.community | |
213 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], software_one.community | |
214 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], software_two.community | |
215 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], software_three.community | |
216 | 216 | end |
217 | 217 | |
218 | 218 | should "software_infos search return only the software in params" do |
... | ... | @@ -225,9 +225,9 @@ class SearchControllerTest < ActionController::TestCase |
225 | 225 | :only_softwares => ["software-three", "java"] |
226 | 226 | ) |
227 | 227 | |
228 | - assert_includes assigns(:searches)[:software_infos][:results], software_two.community | |
229 | - assert_includes assigns(:searches)[:software_infos][:results], software_three.community | |
230 | - assert_not_includes assigns(:searches)[:software_infos][:results], software_one.community | |
228 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], software_two.community | |
229 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], software_three.community | |
230 | + assert_not_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], software_one.community | |
231 | 231 | end |
232 | 232 | |
233 | 233 | should "software_infos search return only the software in params order by Z-A" do |
... | ... | @@ -241,15 +241,15 @@ class SearchControllerTest < ActionController::TestCase |
241 | 241 | :sort => "desc" |
242 | 242 | ) |
243 | 243 | |
244 | - assert_equal assigns(:searches)[:software_infos][:results][0], software_three.community | |
245 | - assert_equal assigns(:searches)[:software_infos][:results][1], software_two.community | |
246 | - assert_not_includes assigns(:searches)[:software_infos][:results], software_one.community | |
244 | + assert_equal assigns(:searches)[:"software_communities_plugin/software_infos"][:results][0], software_three.community | |
245 | + assert_equal assigns(:searches)[:"software_communities_plugin/software_infos"][:results][1], software_two.community | |
246 | + assert_not_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], software_one.community | |
247 | 247 | end |
248 | 248 | |
249 | 249 | |
250 | 250 | should "software_infos search return only enabled softwares" do |
251 | - s1 = SoftwareInfo.first | |
252 | - s2 = SoftwareInfo.last | |
251 | + s1 = SoftwareCommunitiesPlugin::SoftwareInfo.first | |
252 | + s2 = SoftwareCommunitiesPlugin::SoftwareInfo.last | |
253 | 253 | |
254 | 254 | # First get them all normally |
255 | 255 | get( |
... | ... | @@ -257,8 +257,8 @@ class SearchControllerTest < ActionController::TestCase |
257 | 257 | :query => "software" |
258 | 258 | ) |
259 | 259 | |
260 | - assert_includes assigns(:searches)[:software_infos][:results], s1.community | |
261 | - assert_includes assigns(:searches)[:software_infos][:results], s2.community | |
260 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], s1.community | |
261 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], s2.community | |
262 | 262 | |
263 | 263 | s2.community.disable |
264 | 264 | |
... | ... | @@ -268,8 +268,8 @@ class SearchControllerTest < ActionController::TestCase |
268 | 268 | :query => "software" |
269 | 269 | ) |
270 | 270 | |
271 | - assert_includes assigns(:searches)[:software_infos][:results], s1.community | |
272 | - assert_not_includes assigns(:searches)[:software_infos][:results], s2.community | |
271 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], s1.community | |
272 | + assert_not_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], s2.community | |
273 | 273 | end |
274 | 274 | |
275 | 275 | should "software_infos search not return software with secret community" do |
... | ... | @@ -284,9 +284,9 @@ class SearchControllerTest < ActionController::TestCase |
284 | 284 | :software_infos, |
285 | 285 | ) |
286 | 286 | |
287 | - assert_includes assigns(:searches)[:software_infos][:results], software_two.community | |
288 | - assert_includes assigns(:searches)[:software_infos][:results], software_three.community | |
289 | - assert_not_includes assigns(:searches)[:software_infos][:results], software_one.community | |
287 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], software_two.community | |
288 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], software_three.community | |
289 | + assert_not_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], software_one.community | |
290 | 290 | end |
291 | 291 | |
292 | 292 | should "software_infos search not return sisp softwares" do |
... | ... | @@ -301,9 +301,9 @@ class SearchControllerTest < ActionController::TestCase |
301 | 301 | :software_infos, |
302 | 302 | ) |
303 | 303 | |
304 | - assert_includes assigns(:searches)[:software_infos][:results], software_two.community | |
305 | - assert_includes assigns(:searches)[:software_infos][:results], software_three.community | |
306 | - assert_not_includes assigns(:searches)[:software_infos][:results], software_one.community | |
304 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], software_two.community | |
305 | + assert_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], software_three.community | |
306 | + assert_not_includes assigns(:searches)[:"software_communities_plugin/software_infos"][:results], software_one.community | |
307 | 307 | end |
308 | 308 | |
309 | 309 | should "sisp search not return software without sisp" do |
... | ... | @@ -368,12 +368,12 @@ class SearchControllerTest < ActionController::TestCase |
368 | 368 | end |
369 | 369 | |
370 | 370 | def create_software_language(name, version) |
371 | - unless ProgrammingLanguage.find_by_name(name) | |
372 | - ProgrammingLanguage.create(:name => name) | |
371 | + unless SoftwareCommunitiesPlugin::ProgrammingLanguage.find_by_name(name) | |
372 | + SoftwareCommunitiesPlugin::ProgrammingLanguage.create(:name => name) | |
373 | 373 | end |
374 | 374 | |
375 | - software_language = SoftwareLanguage.new | |
376 | - software_language.programming_language = ProgrammingLanguage.find_by_name(name) | |
375 | + software_language = SoftwareCommunitiesPlugin::SoftwareLanguage.new | |
376 | + software_language.programming_language = SoftwareCommunitiesPlugin::ProgrammingLanguage.find_by_name(name) | |
377 | 377 | software_language.version = version |
378 | 378 | software_language.save! |
379 | 379 | |
... | ... | @@ -381,12 +381,12 @@ class SearchControllerTest < ActionController::TestCase |
381 | 381 | end |
382 | 382 | |
383 | 383 | def create_software_database(name, version) |
384 | - unless DatabaseDescription.find_by_name(name) | |
385 | - DatabaseDescription.create(:name => name) | |
384 | + unless SoftwareCommunitiesPlugin::DatabaseDescription.find_by_name(name) | |
385 | + SoftwareCommunitiesPlugin::DatabaseDescription.create(:name => name) | |
386 | 386 | end |
387 | 387 | |
388 | - software_database = SoftwareDatabase.new | |
389 | - software_database.database_description = DatabaseDescription.find_by_name(name) | |
388 | + software_database = SoftwareCommunitiesPlugin::SoftwareDatabase.new | |
389 | + software_database.database_description = SoftwareCommunitiesPlugin::DatabaseDescription.find_by_name(name) | |
390 | 390 | software_database.version = version |
391 | 391 | software_database.save! |
392 | 392 | ... | ... |
src/noosfero-spb/software_communities/test/functional/software_communities_plugin_controller_test.rb
... | ... | @@ -14,20 +14,20 @@ class SoftwareCommunitiesPluginControllerTest < ActionController::TestCase |
14 | 14 | @environment.add_admin(@admin) |
15 | 15 | @environment.save |
16 | 16 | |
17 | - LicenseInfo.create(:version=>"CC-GPL-V2", :link=>"http://creativecommons.org/licenses/GPL/2.0/legalcode.pt") | |
18 | - LicenseInfo.create(:version=>"Academic Free License 3.0 (AFL-3.0)", :link=>"http://www.openfoundry.org/en/licenses/753-academic-free-license-version-30-afl") | |
19 | - LicenseInfo.create(:version=>"Apache License 2.0 (Apache-2.0)", :link=>"http://www.apache.org/licenses/LICENSE-2.0") | |
20 | - LicenseInfo.create(:version=>'BSD 2-Clause "Simplified" or "FreeBSD" License (BSD-2-Clause)', :link=>"http://opensource.org/licenses/BSD-2-Clause") | |
21 | - | |
22 | - ProgrammingLanguage.create(:name =>"Java") | |
23 | - ProgrammingLanguage.create(:name =>"Ruby") | |
24 | - ProgrammingLanguage.create(:name =>"C") | |
25 | - ProgrammingLanguage.create(:name =>"C++") | |
26 | - DatabaseDescription.create(:name => "PostgreSQL") | |
27 | - DatabaseDescription.create(:name => "MySQL") | |
28 | - DatabaseDescription.create(:name => "MongoDB") | |
29 | - DatabaseDescription.create(:name => "Oracle") | |
30 | - OperatingSystemName.create(:name=>"Debian") | |
17 | + SoftwareCommunitiesPlugin::LicenseInfo.create(:version=>"CC-GPL-V2", :link=>"http://creativecommons.org/licenses/GPL/2.0/legalcode.pt") | |
18 | + SoftwareCommunitiesPlugin::LicenseInfo.create(:version=>"Academic Free License 3.0 (AFL-3.0)", :link=>"http://www.openfoundry.org/en/licenses/753-academic-free-license-version-30-afl") | |
19 | + SoftwareCommunitiesPlugin::LicenseInfo.create(:version=>"Apache License 2.0 (Apache-2.0)", :link=>"http://www.apache.org/licenses/LICENSE-2.0") | |
20 | + SoftwareCommunitiesPlugin::LicenseInfo.create(:version=>'BSD 2-Clause "Simplified" or "FreeBSD" License (BSD-2-Clause)', :link=>"http://opensource.org/licenses/BSD-2-Clause") | |
21 | + | |
22 | + SoftwareCommunitiesPlugin::ProgrammingLanguage.create(:name =>"Java") | |
23 | + SoftwareCommunitiesPlugin::ProgrammingLanguage.create(:name =>"Ruby") | |
24 | + SoftwareCommunitiesPlugin::ProgrammingLanguage.create(:name =>"C") | |
25 | + SoftwareCommunitiesPlugin::ProgrammingLanguage.create(:name =>"C++") | |
26 | + SoftwareCommunitiesPlugin::DatabaseDescription.create(:name => "PostgreSQL") | |
27 | + SoftwareCommunitiesPlugin::DatabaseDescription.create(:name => "MySQL") | |
28 | + SoftwareCommunitiesPlugin::DatabaseDescription.create(:name => "MongoDB") | |
29 | + SoftwareCommunitiesPlugin::DatabaseDescription.create(:name => "Oracle") | |
30 | + SoftwareCommunitiesPlugin::OperatingSystemName.create(:name=>"Debian") | |
31 | 31 | |
32 | 32 | @response = ActionController::TestResponse.new |
33 | 33 | end | ... | ... |
src/noosfero-spb/software_communities/test/functional/software_communities_plugin_myprofile_controller_test.rb
... | ... | @@ -19,14 +19,14 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC |
19 | 19 | @offer_1 = create_user('Ana de Souza') |
20 | 20 | @offer_2 = create_user('Angelo Roberto') |
21 | 21 | |
22 | - LicenseInfo.create( | |
22 | + SoftwareCommunitiesPlugin::LicenseInfo.create( | |
23 | 23 | :version=>"CC-GPL-V2", |
24 | 24 | :link=>"http://creativecommons.org/licenses/GPL/2.0/legalcode.pt" |
25 | 25 | ) |
26 | 26 | |
27 | - ProgrammingLanguage.create(:name =>"language") | |
28 | - DatabaseDescription.create(:name => "database") | |
29 | - OperatingSystemName.create(:name=>"Debian") | |
27 | + SoftwareCommunitiesPlugin::ProgrammingLanguage.create(:name =>"language") | |
28 | + SoftwareCommunitiesPlugin::DatabaseDescription.create(:name => "database") | |
29 | + SoftwareCommunitiesPlugin::OperatingSystemName.create(:name=>"Debian") | |
30 | 30 | |
31 | 31 | login_as(@person.user_login) |
32 | 32 | @environment = Environment.default |
... | ... | @@ -52,7 +52,7 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC |
52 | 52 | :profile => @person.identifier, |
53 | 53 | :community => fields[1], |
54 | 54 | :license => fields[0], |
55 | - :software_info => fields[2] | |
55 | + :software_communities_plugin_software_info => fields[2] | |
56 | 56 | ) |
57 | 57 | |
58 | 58 | new_software = Community.find_by_identifier("debian").software_info |
... | ... | @@ -131,7 +131,7 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC |
131 | 131 | end |
132 | 132 | |
133 | 133 | should 'edit a software and does not change Another License values' do |
134 | - another_license = LicenseInfo.create(:version => "Another", :link => "#") | |
134 | + another_license = SoftwareCommunitiesPlugin::LicenseInfo.create(:version => "Another", :link => "#") | |
135 | 135 | software = create_software(software_fields) |
136 | 136 | software.community.add_admin(@person) |
137 | 137 | software.save! |
... | ... | @@ -172,6 +172,7 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC |
172 | 172 | :profile => software.community.identifier, |
173 | 173 | :operating_system => fields[3], |
174 | 174 | :software => fields[4], |
175 | + :license =>{:license_infos_id => SoftwareCommunitiesPlugin::LicenseInfo.last.id} | |
175 | 176 | ) |
176 | 177 | |
177 | 178 | edited_software = Community.find_by_identifier("debian").software_info |
... | ... | @@ -231,7 +232,8 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC |
231 | 232 | post( |
232 | 233 | :edit_software, |
233 | 234 | :profile => software.community.identifier, |
234 | - :software => fields[4] | |
235 | + :software => fields[4], | |
236 | + :license =>{:license_infos_id => SoftwareCommunitiesPlugin::LicenseInfo.last.id} | |
235 | 237 | ) |
236 | 238 | |
237 | 239 | edited_software = Community.find_by_identifier("debian").software_info |
... | ... | @@ -245,17 +247,17 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC |
245 | 247 | post( |
246 | 248 | :new_software, |
247 | 249 | :community => {:name =>"New Software", :identifier => "new-software"}, |
248 | - :software_info => {:finality => "something", :repository_link => ""}, | |
249 | - :license =>{:license_infos_id => LicenseInfo.last.id}, | |
250 | + :software_communities_plugin_software_info => {:finality => "something", :repository_link => ""}, | |
251 | + :license =>{:license_infos_id => SoftwareCommunitiesPlugin::LicenseInfo.last.id}, | |
250 | 252 | :profile => @person.identifier |
251 | 253 | ) |
252 | 254 | |
253 | 255 | new_software = Community.find_by_identifier("new-software").software_info |
254 | - assert_equal new_software.license_info, LicenseInfo.last | |
256 | + assert_equal new_software.license_info, SoftwareCommunitiesPlugin::LicenseInfo.last | |
255 | 257 | end |
256 | 258 | |
257 | 259 | should "create software_info with 'Another' license_info" do |
258 | - license_another = LicenseInfo.create(:version => "Another", :link => "#") | |
260 | + license_another = SoftwareCommunitiesPlugin::LicenseInfo.create(:version => "Another", :link => "#") | |
259 | 261 | @environment.add_admin(@person) |
260 | 262 | |
261 | 263 | another_license_version = "Different License" |
... | ... | @@ -264,7 +266,7 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC |
264 | 266 | post( |
265 | 267 | :new_software, |
266 | 268 | :community => { :name => "New Software", :identifier => "new-software" }, |
267 | - :software_info => { :finality => "something", :repository_link => "" }, | |
269 | + :software_communities_plugin_software_info => { :finality => "something", :repository_link => "" }, | |
268 | 270 | :license => { :license_infos_id => license_another.id, |
269 | 271 | :version => another_license_version, |
270 | 272 | :link=> another_license_link |
... | ... | @@ -272,15 +274,14 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC |
272 | 274 | :profile => @person.identifier |
273 | 275 | ) |
274 | 276 | |
275 | - new_software = Community.find_by_identifier("new-software").software_info | |
276 | - assert_equal license_another.id, new_software.license_info_id | |
277 | - assert_equal license_another.id, new_software.license_info.id | |
278 | - assert_equal another_license_version, new_software.license_info.version | |
279 | - assert_equal another_license_link, new_software.license_info.link | |
277 | + assert_equal SoftwareCommunitiesPlugin::SoftwareInfo.last.license_info_id, license_another.id | |
278 | + assert_equal SoftwareCommunitiesPlugin::SoftwareInfo.last.license_info.id, nil | |
279 | + assert_equal SoftwareCommunitiesPlugin::SoftwareInfo.last.license_info.version, another_license_version | |
280 | + assert_equal SoftwareCommunitiesPlugin::SoftwareInfo.last.license_info.link, another_license_link | |
280 | 281 | end |
281 | 282 | |
282 | 283 | should "create software_info after finish task with 'Another' license_info" do |
283 | - license_another = LicenseInfo.create(:version => "Another", :link => "#") | |
284 | + license_another = SoftwareCommunitiesPlugin::LicenseInfo.create(:version => "Another", :link => "#") | |
284 | 285 | |
285 | 286 | another_license_version = "Different License" |
286 | 287 | another_license_link = "http://diferent.link" |
... | ... | @@ -288,8 +289,7 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC |
288 | 289 | post( |
289 | 290 | :new_software, |
290 | 291 | :community => { :name => "New Software", :identifier => "new-software" }, |
291 | - :software_info => { :finality => "something", :repository_link => "" }, | |
292 | - :license_info => { :version => license_another.version }, | |
292 | + :software_communities_plugin_software_info => { :finality => "something", :repository_link => "" }, | |
293 | 293 | :license => { :license_infos_id => license_another.id, |
294 | 294 | :version => another_license_version, |
295 | 295 | :link=> another_license_link |
... | ... | @@ -300,18 +300,17 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC |
300 | 300 | @environment.add_admin(@person) |
301 | 301 | Task.last.send('finish', @person) |
302 | 302 | |
303 | - new_software = Community.find_by_identifier("new-software").software_info | |
304 | - assert_equal license_another.id, new_software.license_info_id | |
305 | - assert_equal license_another.id, new_software.license_info.id | |
306 | - assert_equal another_license_version, new_software.license_info.version | |
307 | - assert_equal another_license_link, new_software.license_info.link | |
303 | + assert_equal SoftwareCommunitiesPlugin::SoftwareInfo.last.license_info_id, license_another.id | |
304 | + assert_equal SoftwareCommunitiesPlugin::SoftwareInfo.last.license_info.id, nil | |
305 | + assert_equal SoftwareCommunitiesPlugin::SoftwareInfo.last.license_info.version, another_license_version | |
306 | + assert_equal SoftwareCommunitiesPlugin::SoftwareInfo.last.license_info.link, another_license_link | |
308 | 307 | end |
309 | 308 | |
310 | 309 | should "show error messages on create software_info" do |
311 | 310 | post( |
312 | 311 | :new_software, |
313 | 312 | :community => {}, |
314 | - :software_info => {}, | |
313 | + :software_communities_plugin_software_info => {}, | |
315 | 314 | :license => {}, |
316 | 315 | :profile => @person.identifier |
317 | 316 | ) |
... | ... | @@ -327,15 +326,15 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC |
327 | 326 | post( |
328 | 327 | :new_software, |
329 | 328 | :community => {:name =>"New Software", :identifier => "new-software"}, |
330 | - :software_info => {:finality => "something", :repository_link => ""}, | |
331 | - :license =>{:license_infos_id => LicenseInfo.last.id}, | |
329 | + :software_communities_plugin_software_info => {:finality => "something", :repository_link => ""}, | |
330 | + :license =>{:license_infos_id => SoftwareCommunitiesPlugin::LicenseInfo.last.id}, | |
332 | 331 | :profile => @person.identifier |
333 | 332 | ) |
334 | 333 | post( |
335 | 334 | :new_software, |
336 | 335 | :community => {:name =>"New Software", :identifier => "new-software"}, |
337 | - :software_info => {:finality => "something", :repository_link => ""}, | |
338 | - :license =>{:license_infos_id => LicenseInfo.last.id}, | |
336 | + :software_communities_plugin_software_info => {:finality => "something", :repository_link => ""}, | |
337 | + :license =>{:license_infos_id => SoftwareCommunitiesPlugin::LicenseInfo.last.id}, | |
339 | 338 | :profile => @person.identifier |
340 | 339 | ) |
341 | 340 | |
... | ... | @@ -348,8 +347,8 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC |
348 | 347 | post( |
349 | 348 | :new_software, |
350 | 349 | :community => {:name =>"New Software", :identifier => "new-software"}, |
351 | - :software_info => {:finality => "something", :repository_link => ""}, | |
352 | - :license =>{:license_infos_id => LicenseInfo.last.id}, | |
350 | + :software_communities_plugin_software_info => {:finality => "something", :repository_link => ""}, | |
351 | + :license =>{:license_infos_id => SoftwareCommunitiesPlugin::LicenseInfo.last.id}, | |
353 | 352 | :profile => @person.identifier |
354 | 353 | ) |
355 | 354 | |
... | ... | @@ -362,12 +361,12 @@ class SoftwareCommunitiesPluginMyprofileControllerTest < ActionController::TestC |
362 | 361 | end |
363 | 362 | |
364 | 363 | should "dont create software without accept task" do |
365 | - assert_no_difference 'SoftwareInfo.count' do | |
364 | + assert_no_difference 'SoftwareCommunitiesPlugin::SoftwareInfo.count' do | |
366 | 365 | post( |
367 | 366 | :new_software, |
368 | 367 | :community => {:name =>"New Software", :identifier => "new-software"}, |
369 | - :software_info => {:finality => "something", :repository_link => ""}, | |
370 | - :license =>{:license_infos_id => LicenseInfo.last.id}, | |
368 | + :software_communities_plugin_software_info => {:finality => "something", :repository_link => ""}, | |
369 | + :license =>{:license_infos_id => SoftwareCommunitiesPlugin::LicenseInfo.last.id}, | |
371 | 370 | :profile => @person.identifier |
372 | 371 | ) |
373 | 372 | end | ... | ... |
src/noosfero-spb/software_communities/test/functional/software_communities_plugin_profile_controller_test.rb
... | ... | @@ -16,7 +16,7 @@ class SoftwareCommunitiesPluginProfileControllerTest < ActionController::TestCas |
16 | 16 | @environment.enable_plugin('SoftwareCommunitiesPlugin') |
17 | 17 | @environment.save! |
18 | 18 | |
19 | - LicenseInfo.create( | |
19 | + SoftwareCommunitiesPlugin::LicenseInfo.create( | |
20 | 20 | :version=>"CC-GPL-V2", |
21 | 21 | :link=>"http://creativecommons.org/licenses/GPL/2.0/legalcode.pt" |
22 | 22 | ) |
... | ... | @@ -32,8 +32,8 @@ class SoftwareCommunitiesPluginProfileControllerTest < ActionController::TestCas |
32 | 32 | @software = create_software(software_fields) |
33 | 33 | @software.save! |
34 | 34 | |
35 | - download_block = DownloadBlock.new | |
36 | - download_block.downloads = Download.validate_download_list([@download_data]) | |
35 | + download_block = SoftwareCommunitiesPlugin::DownloadBlock.new | |
36 | + download_block.downloads = SoftwareCommunitiesPlugin::Download.validate_download_list([@download_data]) | |
37 | 37 | download_block.save! |
38 | 38 | |
39 | 39 | @software.community.blocks << download_block |
... | ... | @@ -41,7 +41,7 @@ class SoftwareCommunitiesPluginProfileControllerTest < ActionController::TestCas |
41 | 41 | end |
42 | 42 | |
43 | 43 | should 'redirect to download link with correct params' do |
44 | - download_block = DownloadBlock.last | |
44 | + download_block = SoftwareCommunitiesPlugin::DownloadBlock.last | |
45 | 45 | get :download_file, :profile=>@software.community.identifier, |
46 | 46 | :block => download_block.id, :download_index => 0 |
47 | 47 | |
... | ... | @@ -50,7 +50,7 @@ class SoftwareCommunitiesPluginProfileControllerTest < ActionController::TestCas |
50 | 50 | end |
51 | 51 | |
52 | 52 | should "notice when the download was not found" do |
53 | - download_block = DownloadBlock.last | |
53 | + download_block = SoftwareCommunitiesPlugin::DownloadBlock.last | |
54 | 54 | get :download_file, :profile=>@software.community.identifier, |
55 | 55 | :block => 123, :download_index => 0 |
56 | 56 | |
... | ... | @@ -59,23 +59,23 @@ class SoftwareCommunitiesPluginProfileControllerTest < ActionController::TestCas |
59 | 59 | |
60 | 60 | should "display limited community events" do |
61 | 61 | @e1 = Event.new :name=>"Event 1", :body=>"Event 1 body", |
62 | - :start_date=>DateTime.now, | |
63 | - :end_date=>(DateTime.now + 1.month) | |
62 | + :start_date => DateTime.now, | |
63 | + :end_date => (DateTime.now + 1.month) | |
64 | 64 | |
65 | 65 | @e2 = Event.new :name=>"Event 2", :body=>"Event 2 body", |
66 | - :start_date=>(DateTime.now + 10.days), | |
67 | - :end_date=>(DateTime.now + 11.days) | |
66 | + :start_date => (DateTime.now + 10.days), | |
67 | + :end_date => (DateTime.now + 11.days) | |
68 | 68 | |
69 | 69 | @e3 = Event.new :name=>"Event 3", :body=>"Event 3 body", |
70 | - :start_date=>(DateTime.now + 20.days), | |
71 | - :end_date=>(DateTime.now + 30.days) | |
70 | + :start_date => (DateTime.now + 20.days), | |
71 | + :end_date => (DateTime.now + 30.days) | |
72 | 72 | |
73 | 73 | @software.community.events << @e1 |
74 | 74 | @software.community.events << @e2 |
75 | 75 | @software.community.events << @e3 |
76 | 76 | @software.community.save! |
77 | 77 | |
78 | - events_block = SoftwareEventsBlock.new | |
78 | + events_block = SoftwareCommunitiesPlugin::SoftwareEventsBlock.new | |
79 | 79 | events_block.amount_of_events = 2 |
80 | 80 | events_block.display = "always" |
81 | 81 | box = MainBlock.last.box |
... | ... | @@ -89,7 +89,7 @@ class SoftwareCommunitiesPluginProfileControllerTest < ActionController::TestCas |
89 | 89 | end |
90 | 90 | |
91 | 91 | should "notice when given invalid download params" do |
92 | - download_block = DownloadBlock.last | |
92 | + download_block = SoftwareCommunitiesPlugin::DownloadBlock.last | |
93 | 93 | get :download_file, :profile=>@software.community.identifier, |
94 | 94 | :block => download_block.id, :download_index => -5 |
95 | 95 | ... | ... |
src/noosfero-spb/software_communities/test/helpers/software_test_helper.rb
... | ... | @@ -97,7 +97,7 @@ module SoftwareTestHelper |
97 | 97 | hash_list << fields |
98 | 98 | |
99 | 99 | #Fields for license info |
100 | - fields_license['license_infos_id'] = LicenseInfo.last.id | |
100 | + fields_license['license_infos_id'] = SoftwareCommunitiesPlugin::LicenseInfo.last.id | |
101 | 101 | hash_list << fields_license |
102 | 102 | |
103 | 103 | hash_list | ... | ... |
src/noosfero-spb/software_communities/views/search/_catalog_result_list.html.erb
... | ... | @@ -13,7 +13,7 @@ |
13 | 13 | <% end %> |
14 | 14 | <% end %> |
15 | 15 | |
16 | - <%name="software_infos"#TODO remove this %> | |
16 | + <%name="software_communities_plugin/software_infos"#TODO remove this %> | |
17 | 17 | <% display = display_filter(name, params[:display]) %> |
18 | 18 | |
19 | 19 | <div class="search-results-innerbox <%= 'common-profile-list-block' if SearchHelper::COMMON_PROFILE_LIST_BLOCK.include?(name) %>"> | ... | ... |
src/noosfero-spb/software_communities/views/search/_full_community.html.erb
... | ... | @@ -2,7 +2,8 @@ |
2 | 2 | <li class="search-software-item"> |
3 | 3 | <div class="search-software-item-column-left"> |
4 | 4 | <div class="vcard"> |
5 | - <% unless community.organization_ratings.empty?%> | |
5 | + | |
6 | + <% unless community.organization_ratings.empty? %> | |
6 | 7 | <%= render :partial => 'shared/organization_average_rating_block', :locals => {:community => community}%> |
7 | 8 | <% end %> |
8 | 9 | ... | ... |