-
Notifications
You must be signed in to change notification settings - Fork 896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add textual summary for orchestration_stack on the service summary page #12954
Add textual summary for orchestration_stack on the service summary page #12954
Conversation
@miq-bot add_label wip, ui, bug |
49c0ad9
to
5394138
Compare
@miq-bot remove_label wip |
expect(textual_orchestration_stack).to eq(@os_cloud) | ||
end | ||
|
||
it 'contains the link to the associated stack' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the description is the same for both cases, can you add cloud & infra to the descriptions so that they differ please?
Ok, looking around, it's probably ok to do it this way. But the specs look strange. @skateman : can you, pls, tell how to fix the specs here? |
It feels weird that a non-nil orchestration stack is returned in the first place. But assuming that's the correct behaviour, yup, decorators would be perfect for the job :). But.. it would be the first textual-summary-related use of decorators in miq, so not sure if now.. |
|
||
subject { textual_orchestration_stack } | ||
it 'contains the link to the associated stack' do | ||
@os_cloud = FactoryGirl.create(:orchestration_stack_cloud, :name => "cloudstack1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using instance variables here doesn't make any sens, could you export this to let
blocks combined with contexts. Something like this:
subject { FactoryGirl.create(cloud, :name => name) }
context "openstack-cloud" do
let(:cloud) { :orchestration_stack_cloud }
let(:name) { 'cloudstack1' }
it 'contains the link to the associated stack' do
# expect(subject...)
end
end
context "openstack-infra" do
let(:cloud) { :orchestration_stack_openstack_infra }
let(:name) { 'infrastack1' }
it 'contains the link to the associated stack' do
# expect(subject...)
end
end
# ...
5394138
to
e5d00bb
Compare
if ost && !ost.id.present? | ||
{ | ||
:label => _("Orchestration Stack"), | ||
:image => "orchestration_stack", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e5d00bb
to
82337cd
Compare
end | ||
|
||
subject { textual_orchestration_stack } | ||
it 'contains the link to the associated stack' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you using the same it
twice in the same context? Please create a nested-context for both cases.
let(:os_infra) { FactoryGirl.create(:orchestration_stack_openstack_infra, :name => "infrastack1") } | ||
|
||
before do | ||
login_as @user = FactoryGirl.create(:user) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused instance variable @user
@@ -0,0 +1,30 @@ | |||
describe ServiceHelper::TextualSummary do | |||
context ".textual_orchestration_stack" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here you want describe
instead of context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skateman - I have changed it - but I do not really agree - context is an alias of describe - and usually - describe wraps the user story, and context the individual scenario. We, as a team -can decide on a set of guidelines for how we mark our specs.
subject { textual_orchestration_stack } | ||
it 'contains the link to the associated stack' do | ||
@record = FactoryGirl.create(:service) | ||
allow(@record).to receive(:orchestration_stack).and_return(os_cloud) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need instance variables here using record
is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
82337cd
to
e435886
Compare
e435886
to
063b72f
Compare
Checked commits lgalis/manageiq@367b2a6~...063b72f with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
@lgalis true, they're aliased but there is a semantic difference. Describe
refers to describing a class' or method's behavior while context refers to
a context with different external attributes than outside the context.
…On Tue, Dec 13, 2016 at 6:11 PM, lgalis ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In spec/helpers/service_helper/textual_summary_spec.rb
<#12954>:
> @@ -0,0 +1,30 @@
+describe ServiceHelper::TextualSummary do
+ context ".textual_orchestration_stack" do
@skateman <https://github.com/skateman> - I have changed it - but I do
not really agree - context is an alias of describe - and usually - describe
wraps the user story, and context the individual scenario. We, as a team
-can decide on a set of guidelines for how we mark our specs.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12954>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAnnqg6VFdltw1leu6ALE0ay-JCBOhstks5rHtGygaJpZM4LB6PD>
.
--
Dávid Halász
dhalasz@redhat.com
Brno TPB 2A217
Extension: 82 62532
Phone: +420 532 294 532
IRC: skateman
|
if it helps, the difference will be - :image => "100/orchestration_stack.png",
+ :image => "orchestration_stack", |
…ervice_summary_page Add textual summary for orchestration_stack on the service summary page (cherry picked from commit 9f4bfb1) https://bugzilla.redhat.com/show_bug.cgi?id=1411373
Euwe backport details (fixed image path):
|
Depends on #13089
Handle empty orchestration stack link in the service summary page.
A service for RHOS can contain an empty orchestration stack. This PR changes the summary page for the service to handle this.
Links
https://bugzilla.redhat.com/show_bug.cgi?id=1394485
Steps for Testing
1.Create a Service for RHOS using a non-existing stack name
2.The link for the stack in the service's summary page is invalid - this PR removes the link
Before:
After: